I have a folder full of RTF files saved with .doc extensions created by the
Adobe Acrobate 6.0 Standard Save As feature. I found the following macro
code at http://support.microsoft.com/default.aspx?scid=kb;en-us;242875:

Sub convert()

Dim strFile As String
Dim X As String
Dim Y As String
Dim Z As Object
'Collect Drive and directory to convert Word Docs in.
X = InputBox("Please enter the drive the documents are on.", "Drive
Letter", "C")
Y = InputBox("Please enter the path to the directory the files are in.",
"Path to files", "My Documents")
'seed the string to the first file in the directory
strFile = Dir(X & ":\" & (Y) & "\" & "*.rtf")
' Start looping through files opening and saving as current version of Word.
On Error Resume Next
Do While strFile <> ""
Documents.Open X & ":\" & (Y) & "\" & strFile, Format:=wdOpenFormatRTF
ActiveDocument.SaveAs (X & ":\" & Y & "\" & strFile), FileFormat =
wdFormatDocument
ActiveDocument.Close
strFile = Dir

Loop
'Alert user operation is complete
MsgBox "done"

End Sub

How do I convert this code into a stand-alone script file so I can
distribute it?
--
Regards,

Ward

Re: Converting RTF to DOCs by Word

Word
Thu Apr 14 20:49:02 CDT 2005

G'day "Ward" <Ward@discussions.microsoft.com>,

As your users run Word, stick the code in a document's VBA project
with a macrobutton in the document content to invoke it.

Steve Hudson - Word Heretic

steve from wordheretic.com (Email replies require payment)
Without prejudice


Ward reckoned:

>I have a folder full of RTF files saved with .doc extensions created by the
>Adobe Acrobate 6.0 Standard Save As feature. I found the following macro
>code at http://support.microsoft.com/default.aspx?scid=kb;en-us;242875:
>
>Sub convert()
>
> Dim strFile As String
> Dim X As String
> Dim Y As String
> Dim Z As Object
>'Collect Drive and directory to convert Word Docs in.
> X = InputBox("Please enter the drive the documents are on.", "Drive
>Letter", "C")
> Y = InputBox("Please enter the path to the directory the files are in.",
>"Path to files", "My Documents")
>'seed the string to the first file in the directory
> strFile = Dir(X & ":\" & (Y) & "\" & "*.rtf")
>' Start looping through files opening and saving as current version of Word.
> On Error Resume Next
> Do While strFile <> ""
> Documents.Open X & ":\" & (Y) & "\" & strFile, Format:=wdOpenFormatRTF
> ActiveDocument.SaveAs (X & ":\" & Y & "\" & strFile), FileFormat =
>wdFormatDocument
> ActiveDocument.Close
> strFile = Dir
>
> Loop
>'Alert user operation is complete
> MsgBox "done"
>
>End Sub
>
>How do I convert this code into a stand-alone script file so I can
>distribute it?