Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / June 2004

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Alex K. Angelopoulos [MVP] - 30 Jun 2004 05:09 GMT
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?
Alex K. Angelopoulos [MVP] - 01 Jul 2004 00:42 GMT
> I'm working on a generalized document converter which hypothetically
> should be usable from Office 97 through 2003. Emphasis on
[quoted text clipped - 3 lines]
> 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)
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.