Re: Converting RTF to DOCs
- From: Word Heretic <myfullname@xxxxxxxxxx>
- Date: Fri, 15 Apr 2005 11:49:02 +1000
G'day "Ward" <Ward@xxxxxxxxxxxxxxxxxxxxxxxxx>,
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?
.
- References:
- Converting RTF to DOCs
- From: Ward
- Converting RTF to DOCs
- Prev by Date: Re: My computer crashed
- Next by Date: Re: Inserting text at ranges.....
- Previous by thread: Converting RTF to DOCs
- Next by thread: GetAddress differences
- Index(es):