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

Posted on 2003-02-20
Medium Priority
Last Modified: 2010-04-07
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!!!

Question by:kerryw60
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
LVL 27

Accepted Solution

Dabas earned 400 total points
ID: 7988824
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 ---------


Author Comment

ID: 7993910
Thanks Dabas!

Author Comment

ID: 8072772
Do I need to do anything to close this?
LVL 27

Expert Comment

ID: 8074340
You already did, thanks for the points!

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month9 days, 17 hours left to enroll

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question