mathzhang
11-22-2010, 10:53 AM
Hi Guys,
I simply want to save a .rtf file into .txt format. Here is the code:
Dim file_path As String
file_path = "d:\working\vba\filename.rtf"
Dim wdApp As Word.Application
Set wdApp = GetObject(, "Word.Application")
Dim wdDoc As Word.Document
Set wdDoc = wdApp.Documents.Open(file_path)
wdDoc.Activate
wdDoc.SaveAs Filename:="d:\working\vba\filename.txt", _
FileFormat:=wdFormatText
wdDoc.Close
However, I always got the following warning message:
" The document may contain text content that will be lost upon conversion to the chosed encoding..... Do you want to continue saving the document?"
The program can only go on if I choose "YES". Any idea how to suppress this warning message? Thanks very much!
I simply want to save a .rtf file into .txt format. Here is the code:
Dim file_path As String
file_path = "d:\working\vba\filename.rtf"
Dim wdApp As Word.Application
Set wdApp = GetObject(, "Word.Application")
Dim wdDoc As Word.Document
Set wdDoc = wdApp.Documents.Open(file_path)
wdDoc.Activate
wdDoc.SaveAs Filename:="d:\working\vba\filename.txt", _
FileFormat:=wdFormatText
wdDoc.Close
However, I always got the following warning message:
" The document may contain text content that will be lost upon conversion to the chosed encoding..... Do you want to continue saving the document?"
The program can only go on if I choose "YES". Any idea how to suppress this warning message? Thanks very much!