Word.SaveAs in Word 2007 Compatiblity Mode issue

B

bitpusher1010

I'm using VBA to open a DOC file and save it as DOCX.

ActiveDocument.SaveAs(sTargetFile, lTargetType, False, "", False, "", False)

However, upon opening the 'converted file' it still says it is in
compatiblity mode. This is not desirable.

I can manually open the DOC file in Word, and Save As DOCX however it
prompts me about the compatiblity issue, and then I can properly save the
DOC file as DOCX. Opening the DOCX file with this method works as it should,
not in compatability mode.

Any thoughts, insights are greatly appreciated.

Allen
 
D

Doug Robbins - Word MVP

Are you using wdFormatXMLDocument as the 1TargetType

If I use ActiveDocument.SaveAs "Newtest.docx", wdFormatXMLDocument to save a
Word 2003 document, even Word continues to indicate that the document is
open/opened in Compatibility Mode, I have found that if I change the
extension of the file from docx to zip, I can open the zip file and see the
various components just as if I had done that with a document created in
Word 2007 and saved in docx format.

I therefore come to the conclusion that the display of Compatibility Mode is
not necessarily correct.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
 
B

bitpusher1010

Yes, I'm using (wdFormatXMLDocument = 12). Regardless, it is a huge
annoyance in my case, as I want the doc to appear without doubt, to be an
DOCX file. Are there any potential answers? Manually I can SaveAs, answer
the DialogBox question regarding compatibility, then walah, it opens without
the compatibility mode issue. Would love to do this same thing via VBA.
 
T

Tony Jollans

There are two aspects to Word 2007 documents: the format of the file, and
(if in the new format) whether or not all new features are enabled. What you
are doing is forcibly saving in the new format without enabling the new
features. Try this, instead:

ActiveDocument.Convert
ActiveDocument.SaveAs "NewName.docx"
 
B

bitpusher1010

Perfect. Thank you.

Tony Jollans said:
There are two aspects to Word 2007 documents: the format of the file, and
(if in the new format) whether or not all new features are enabled. What
you are doing is forcibly saving in the new format without enabling the
new features. Try this, instead:

ActiveDocument.Convert
ActiveDocument.SaveAs "NewName.docx"

--
Enjoy,
Tony

www.WordArticles.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top