View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
joel joel is offline
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.