Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Converting RTF file into TXT file

1. I would like to know how I can convert a file with RTF (Rith Text Format)
extension into a file with TXT extension using VBA code. I tried
"FileSystemObject.OpenAsTextFile" method but it did not work very well.

2. Is it possible to convert a file.RTF into file.XLS directly using VBA code?

Thanks In Advance.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Converting RTF file into TXT file

You cxan use the code below to convert the rtf to text and then open the text
file

FName = "c:\temp\abc.rtf"
SaveFName = "c:\temp\abc.txt"
Set wordobj = GetObject(FName)
wordobj.SaveAs Filename:=SaveFName, _
FileFormat:=wdFormatText, _
InsertLineBreaks:=False, _
AllowSubstitutions:=False, _
LineEnding:=wdCRLF

"Alogon" wrote:

1. I would like to know how I can convert a file with RTF (Rith Text Format)
extension into a file with TXT extension using VBA code. I tried
"FileSystemObject.OpenAsTextFile" method but it did not work very well.

2. Is it possible to convert a file.RTF into file.XLS directly using VBA code?

Thanks In Advance.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Converting a CSV file to an Excel file Gordon Biggar New Users to Excel 3 March 26th 09 02:17 PM
CONVERTING EXCEL FILE TO DBF FILE IN OFFICE 2007 rajesh Excel Programming 0 July 17th 08 11:26 AM
Converting Excel file to text delimited file Kiran Veeramallu[_2_] Excel Discussion (Misc queries) 3 May 1st 07 07:04 PM
Converting excel file to tab delimited (txt) file Kusuma Excel Discussion (Misc queries) 1 December 18th 06 08:04 AM
converting .PDF file to .xls or .txt file Mary Excel Discussion (Misc queries) 1 December 20th 04 02:13 PM


All times are GMT +1. The time now is 10:59 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"