Document converters - external converter #s and DefaultOpenFormat don't mix?

  • Thread starter Alex K. Angelopoulos [MVP]
  • Start date
A

Alex K. Angelopoulos [MVP]

I'm working on a generalized document converter which hypothetically should
be usable from Office 97 through 2003. Emphasis on "hypothetically". :)

I set Word to automatically open documents fed to it by using
It generally seems to work OK for opening files which have internal
filters - meaning the ones I can see in the wdOpenFormat enumeration - but
when I try to open something like an Excel spreadsheet after setting Word's
Options.DefaultOpenFormat to wdOpenFormatAllWord, it makes a hash of it.
When I try to explicitly set the open type to the numeric OpenFormat for the
Excel FileConverter (which is 9 on my system) Word throws an "out of range"
error. It looks like it can't handle anything that isn't explicitly in the
wdOpenFormat enum as DefaultOpenFormat.

Do I have to explicitly set this as an argument to Documents.Open? Or is
there another way around that?
 
A

Alex K. Angelopoulos [MVP]

Alex said:
I'm working on a generalized document converter which hypothetically
should be usable from Office 97 through 2003. Emphasis on
"hypothetically". :)

...When I try to explicitly set the open type to the
numeric OpenFormat for the Excel FileConverter (which is 9 on my
system) Word throws an "out of range" error...

The real problem here is that the converter was missing.
Do I have to explicitly set this as an argument to Documents.Open? Or is
there another way around that?

This still stands as a question. For now I've just expanded the call, using
vbNullString values where possible; this is a VBScript class (thus the "Me"
keyword), and .Word, .ConfirmConversions, and .OpenFormat are actually
public class properties which have been set to the instance of Word and some
persistent parameter values respectively...


Set Me.Document = Me.Word.Documents.Open(sourcePath, _
Me.ConfirmConversions, True, False, vbNullString, _
vbNullString, True, vbNullString, vbNullString, Me.OpenFormat)
 

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