Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 171
  • Last Modified:

Change (Save as type) MyDoc.rtf to MyDoc.doc

Ultimate goal: Allow user to email an Access report that's password protected.

What I have so far:
I have the beginning and end, but missing the middle.

Doing this in VBA and can convert an Access report to an RTF which can be opened in Word.

I can add a Password to a Word.doc, but you can't use the password feature in Word with Word.rtf.

Is there a way to access the SAVE AS TYPE in code to save as a "Word Document (*.doc)"  ???

I'm new to this. Am I being clear enough with my question?

Thanks for any help anyone can provide!!!

  • 2
  • 2
1 Solution
This is out of VBAWRD8.HLP.
As you can see, you can specify a FileName and a FileFormat. If the latter is wdFormatDocument, the document is saved in Word format.

-----------Paste starts here-------

Saves the specfied document with a new name or format. The arguments for this method correspond to the options in the Save As dialog box (File menu).


expression.SaveAs(FileName, FileFormat, LockComments, Password, AddToRecentFiles, WritePassword, ReadOnlyRecommended, EmbedTrueTypeFonts, SaveNativePictureFormat, SaveFormsData, SaveAsAOCELetter)

expression   Required. An expression that returns a Document object.

FileName   Optional Variant. The name for the document. The default is the current folder and file name. If the document has never been saved, the default name is used (for example, Doc1.doc). If a document with the specified FileName already exists, the document is overwritten without the user being prompted first.

FileFormat   Optional Variant. The format in which the document is saved. Can be one of the following WdSaveFormat constants: wdFormatDocument, wdFormatDOSText, wdFormatDOSTextLineBreaks, wdFormatRTF, wdFormatTemplate, wdFormatText, wdFormatTextLineBreaks, or wdFormatUnicodeText. To save a document in another format, specify the appropriate value for the SaveFormat property of the FileConverter object.

LockComments   Optional Variant. True to lock the document for comments.

Password   Optional Variant. A password string for opening the document.

AddToRecentFiles   Optional Variant. True to add the document to the list of recently used files on the File menu.

WritePassword   Optional Variant. A password string for saving changes to the document.

ReadOnlyRecommended   Optional Variant. True to have Word suggest read-only status whenever the document is opened.

EmbedTrueTypeFonts   Optional Variant. True to save TrueType fonts with the document.

SaveNativePictureFormat   Optional Variant. If graphics were imported from another platform (Macintosh), True to save only the Windows version of the imported graphics.

SaveFormsData   Optional Variant. True to save the data entered by a user in a form as a data record.

SaveAsAOCELetter   Optional Variant. If the document has an attached mailer, True to save the document as an AOCE letter (the mailer is saved).

-----End of Paste ---------

kerryw60Author Commented:
Thanks Dabas!
kerryw60Author Commented:
Do I need to do anything to close this?
You already did, thanks for the points!

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now