Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / October 2007

Tip: Looking for answers? Try searching our database.

Turn off compatibility mode in template for Word 2007

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Luca Brasi - 05 Oct 2007 08:45 GMT
I would like to use something like

Set doc = Documents.Open("C:\Test.dot")
doc.SaveAs "C:\Test.dotx", WdSaveFormat.wdFormatXMLTemplate

to convert several old templates in the new Word 2007 file format.

Problem is that the saved new templates still are in compatibility mode.
Can I turn that off with VBA?

Thanks for any hints.
Jay Freedman - 05 Oct 2007 15:51 GMT
> I would like to use something like
>
[quoted text clipped - 7 lines]
>
> Thanks for any hints.

Between opening and saving, use the Convert method

  doc.Convert

documented at http://msdn2.microsoft.com/en-us/library/bb243727.aspx. This
is the same as opening the Office button menu and clicking the Convert item
(which is visible only if the document or template is in compatibility
mode).

I don't have Word 2007 handy here to check, but I suspect you might get an
error from calling Convert for a document/template that was not in
compatibility mode. I couldn't find any property of the Document object that
would tell you whether the current document is in that mode, but an On Error
statement might catch such an error.

Signature

Regards,
Jay Freedman
Microsoft Word MVP        FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

Luca Brasi - 07 Oct 2007 14:21 GMT
Thank you Jay, works perfectly!
Luca

>> I would like to use something like
>>
[quoted text clipped - 22 lines]
> would tell you whether the current document is in that mode, but an On Error
> statement might catch such an error.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.