Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Word dotx to docx 1

Status
Not open for further replies.

Andrzejek

Programmer
Jan 10, 2006
8,530
US
I created a template in Word, and named it with the extension of .dotx (since it is a template). Then user can populate this template with the data from my DB. All is fine.

But the user still sees this document as a dotx and not as a ;regular’ docx Word document. They have to do Save As, change the Save As Type to “Word document (*.docx)”, otherwise the dotx sticks around.

Is there anywhere in VBA code I can change the type of this document from dotx to docx? I cannot save it completely in the code because I don’t know the file name and the location of that file. It is up to the user.

BTW, my original dotx document is Read Only so users cannot overwrite it (I hope)

---- Andy

There is a great need for a sarcasm font.
 
How are you opening the file?

Cheers
Paul Edstein
[MS MVP - Word]
 

Code:
Documents.Open FileName:=strSUMMARY_REPORT_TEMPLATE, _
    ConfirmConversions:=False, ReadOnly:=True, AddToRecentFiles:=False, _
    PasswordDocument:="", PasswordTemplate:="", Revert:=False, _
    WritePasswordDocument:="", WritePasswordTemplate:="", Format:= _
    wdOpenFormatAuto, XMLTransform:=""

Where [tt]strSUMMARY_REPORT_TEMPLATE[/tt] is the path and file name of my template.


---- Andy

There is a great need for a sarcasm font.
 
Yes, I just simply need:

Code:
Documents.Add Template:=strSUMMARY_REPORT_TEMPLATE

Found it here. [thumbsup2]


---- Andy

There is a great need for a sarcasm font.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top