PC Review


Reply
Thread Tools Rate Thread

Converting RTF file into TXT file

 
 
Alogon
Guest
Posts: n/a
 
      3rd Dec 2008
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 With Quote
 
 
 
 
Joel
Guest
Posts: n/a
 
      3rd Dec 2008
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 With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Converting Excel file to text delimited file =?Utf-8?B?S2lyYW4gVmVlcmFtYWxsdQ==?= Microsoft Excel Misc 3 1st May 2007 07:04 PM
Converting AOL email archive file to an Outlook 2003 compatible file J.S. Microsoft Outlook Discussion 2 12th Dec 2006 11:20 AM
Converting an Excel file to fixed length ASCII (text) file =?Utf-8?B?WUkgTWFu?= Microsoft Excel Misc 2 5th Oct 2004 12:00 AM
converting a .avi file back to a .mov file using rad video tools =?Utf-8?B?c2hlcnJp?= Windows XP MovieMaker 1 24th May 2004 03:12 AM
Converting Dataset to a .IND file( dbaseIV index file) Hari Microsoft ADO .NET 0 12th Jul 2003 11:02 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:39 AM.