W
Ward
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?
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?