Word - Turn off compatibility mode in template for Word 2007

Asked By Luca Brasi on 05-Oct-07 03:45 AM
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 replied on 05-Oct-07 10:51 AM
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.

--
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 replied on 07-Oct-07 09:21 AM
Thank you Jay, works perfectly!
Luca