importWord

  how to "automatic" way to transform the .DOC files to .RTF
richtext text_conversion




  Doc2Rtf
>I need to import into Director text members, 200 word documents (Word
>97). Also change the tipo.
>
>Do you know any "automatic" way to transform the .DOC files to .RTF or
>something else?
>
>Thanks in advance for your help. Sorry for the Off Topic question.
>Regards. Maximo Pieretti.
>
>


Maximo,

Word comes with VBA  which lets you automate quite a lot. 
The two functions below iterate through all the files of the current directory,
open the DOC and save it as RTF. (Actually, mafile.doc will be saved as myfile.doc.rtf. 
So there is still something left to improve;)

record a new macro in word, just something to start with.
open the macro edit window and choose editing the new macro.
select all the recorded and replace it with the 2 functions below.
Test. Save. 

Sub SaveAllDocInCurrDirAsRtf ()
Dim Pfad, datei
Pfad = CurDir
datei = Dir(Pfad & "\*.Doc")
While datei <> ""
  openDocSAveRtf (datei)
  datei = Dir()
Wend

End Sub



Sub openDocSAveRtf(datei)
'
'
    Documents.Open FileName:=datei, ConfirmConversions:=False _
        , ReadOnly:=False, AddToRecentFiles:=False, PasswordDocument:="", _
        PasswordTemplate:="", Revert:=False, WritePasswordDocument:="", _
        WritePasswordTemplate:="", Format:=wdOpenFormatAuto
    ActiveDocument.SaveAs FileName:=datei & ".rtf", FileFormat:= _
        wdFormatRTF, LockComments:=False, Password:="", AddToRecentFiles:=True, _
        WritePassword:="", ReadOnlyRecommended:=False, EmbedTrueTypeFonts:=False, _
         SaveNativePictureFormat:=False, SaveFormsData:=False, SaveAsAOCELetter:= _
        False
    ActiveWindow.Close
End Sub


Hope it helps


Home shock + cgi Bits 'n pieces Director Lingo Shocklets Contact










pageID=l_importWord