Microsoft Office Forums

Go Back   Microsoft Office Forums > Microsoft Word > Word VBA

Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 02-25-2016, 09:23 AM
mktate mktate is offline Windows 10 Office 2010 64bit
Novice
 
Join Date: Dec 2015
Posts: 24
mktate is on a distinguished road
Default .DOTM files not opening as .DOCX with userform


I have completed a userform that opens multiple templates depending upon user choices and inputs data from the userform into these templates. The user is then supposed to use "save as" to save the opened and modified files as new documents on the system. The issue I have is that when the templates are opened they are retaining their original location/filepath and .DOTM extension rather than opening as new files (document 1, document 2, etc.). I thought they would open as .DOCX and that is what is desired. I am using Documents.Open with the filepath to open the various templates. Howver, the userform is opening the templates as if I am right clicking on the templates to edit the templates rather than as if I am double clicking on the templates to use them to create new documents (if that makes sense).

If I double click the templates directly (rather than through the userform), the templates properly open as .DOCX files and as new documents (document 1, document 2). So, is there some additional code I need to put into the userform so the templates will open to create new documents from them correctly? Thanks for any help.
Reply With Quote
  #2  
Old 02-25-2016, 03:02 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 17,485
macropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to behold
Default

Why is the template being opened? You should be creating a new document from it (e.g. by double-clicking on the template or by selecting it via File>New).
__________________
Cheers,
Paul Edstein
[MS MVP - Word]
Reply With Quote
  #3  
Old 02-26-2016, 07:07 AM
mktate mktate is offline Windows 10 Office 2010 64bit
Novice
 
Join Date: Dec 2015
Posts: 24
mktate is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
Why is the template being opened? You should be creating a new document from it (e.g. by double-clicking on the template or by selecting it via File>New).
The templates are being opened from the Userform depending upon user answers - so you can't click on file etc. I found the answer myself- use Documents.Add instead of Documents.Open with .dotm files and it does open correctly -
Reply With Quote
  #4  
Old 02-26-2016, 02:17 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 17,485
macropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to behold
Default

Quote:
Originally Posted by mktate View Post
I found the answer myself- use Documents.Add instead of Documents.Open with .dotm files and it does open correctly -
Precisely! Your code was opening the template for editing, not creating a new document from it.
__________________
Cheers,
Paul Edstein
[MS MVP - Word]
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Word 360: Opening .docx document arjfca Word 2 08-22-2015 04:20 AM
Opening Word /Excel reinstalls files, loses recent files adj1 Office 3 05-10-2013 12:27 AM
Docx files not opening with Office 2013 IceWine Word 3 01-09-2013 05:26 PM
How to convert docm to dotm without opening the file Moz Word 1 12-20-2012 04:23 PM
Opening .docx attachment ADKREV Word 4 01-24-2011 02:58 AM


All times are GMT -7. The time now is 01:34 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
MSOfficeForums.com is not affiliated with Microsoft