×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Word dotx to docx

Word dotx to docx

Word dotx to docx

(OP)
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.

RE: Word dotx to docx

How are you opening the file?

Cheers
Paul Edstein
[MS MVP - Word]

RE: Word dotx to docx

(OP)

CODE

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

Where strSUMMARY_REPORT_TEMPLATE is the path and file name of my template.


---- Andy

There is a great need for a sarcasm font.

RE: Word dotx to docx

(OP)
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.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close