creating rtf document from within Word

L

Larry

Hi, all,

Is it possible to create an .rtf document from within Word using VBA?
Sometimes I open and work on existing rtf documents in Word, but I'm
wondering if it's possible to create them from within Word as well.

Larry
 
J

JB

Larry said:
Hi, all,

Is it possible to create an .rtf document from within Word using VBA?
Sometimes I open and work on existing rtf documents in Word, but I'm
wondering if it's possible to create them from within Word as well.

Larry
Yes just save as .rtf

Dim MyDialog As Dialog
Set MyDialog = Dialogs(wdDialogFileSaveAs)

With MyDialog
.Name = strRecDocName & ".rtf"
.Format = wdFormatRTF
.addtomru = 0
End With

HTH

J
 
L

Larry

Well I realized it was a stupid question. It's not a matter of creating
an rtf document out of the blue, but of creating a new unsaved Word
document and then saving that as an rtf document, something like this:

X = InputBox("Enter name of rtf file to be created", "Create RTF File")

Documents.Add
ActiveDocument.SaveAs FileName:=X & ".rtf", FileFormat:=wdFormatRTF

This would take more modifications, but it probably is not worth the
trouble and one could just use the Save As dialog instead.

Larry
 
L

Larry

Thanks.

Larry


Yes just save as .rtf

Dim MyDialog As Dialog
Set MyDialog = Dialogs(wdDialogFileSaveAs)

With MyDialog
.Name = strRecDocName & ".rtf"
.Format = wdFormatRTF
.addtomru = 0
End With

HTH

J
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top