No .docx file converter on Word 2007

R

realexander

Hi,

I've installed Office 2007 on my system. I instantiate Word in C++ with
CreateDispatch("Word.Application"), I verify that I have version 12,
then call GetFileConverters and go through them all. The strange thing
is, there's no FileConverter for .docx. Also, there's no converter for
..htm, .rtf, or any of several other formats I'd expect. All I see are
..wps, .wpd, .wri, and .doc (which I'm now suspecting refers to
WordPerfect's .doc, not Microsoft's).

Is this because FileConverters do not include "native" Word formats? Is
there a way for me to get a list of all file extensions that the
currently installed version of Word can open?

Thanks,
Bob Alexander
 
C

Cindy M.

Hi Realexander,
I've installed Office 2007 on my system. I instantiate Word in C++ with
CreateDispatch("Word.Application"), I verify that I have version 12,
then call GetFileConverters and go through them all. The strange thing
is, there's no FileConverter for .docx. Also, there's no converter for
..htm, .rtf, or any of several other formats I'd expect. All I see are
..wps, .wpd, .wri, and .doc (which I'm now suspecting refers to
WordPerfect's .doc, not Microsoft's).

Is this because FileConverters do not include "native" Word formats? Is
there a way for me to get a list of all file extensions that the
currently installed version of Word can open?
Well, you won't find a converter for docx because that's the "native"
Word 2007 file format. Some conversions are part of the basic
application; some are installed as separate converter files. The latter
are what you get from the FileConverers collection.

The other formats you should find listed under the WdSaveFormat
enumeration.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 
R

realexander

Cindy said:
Well, you won't find a converter for docx because that's the "native"
Word 2007 file format. ...

The other formats you should find listed under the WdSaveFormat
enumeration.

Unfortunately, there seems to be no way to know at run time which
WdSaveFormats the installed version of Word supports (apart from trying
to save a file and seeing if it fails).

- Bob Alexander
 
S

Steve Rindsberg

Realexander said:
Unfortunately, there seems to be no way to know at run time which
WdSaveFormats the installed version of Word supports (apart from trying
to save a file and seeing if it fails).

Haven't tried this but rather than attempting a save with each of the
wdSaveFormat params, how about a quick 'n dirty little test like consecutively
attempting to set x = wdEverySaveFormatYouWant and trapping any errors that
result (ie, if the particular constant's undefined, you know it's not
available).
 
C

Cindy M.

Hi Realexander,
Unfortunately, there seems to be no way to know at run time which
WdSaveFormats the installed version of Word supports (apart from trying
to save a file and seeing if it fails).
Have you ever seen a case when the formats you can specify using
WdSaveFormat don't work? I think (but I could well be wrong) that these
are always available (as opposed to the file converters that are
external).

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 
S

Steve Rindsberg

Hi Cindy
Have you ever seen a case when the formats you can specify using
WdSaveFormat don't work? I think (but I could well be wrong) that these
are always available (as opposed to the file converters that are
external).

I think realalexander's trying to make sure that the code'll work on multiple
versions of Word (ie, different SaveAs options).

Simplest thing might be to do the homework ahead of time, hardcode an array of
what's available in each version and use that.
 

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