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

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

Post by Alex K. An » Thu, 01 Jul 2004 13:09:41


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?
 
 
 

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

Post by Alex K. An » Fri, 02 Jul 2004 08:42:34


The real problem here is that the converter was missing.


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)