Documents.Open Behavior Differences

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

I am seeing Word 2007 treat HTML files differently when opening through an
automation client (C#) and in Word. Specifically, when I load an html file
that has numbering using Word directly, it automatically senses the file type
and loads it perfectly. When I try to load the same file using Open(), it
flubs the numbering.

Some things I tried:

1. Captured a macro of me loading the file. Copied same arguments to C#
automation client. No dice.

2. Changed confirmConversions argument of Open to true (from false). Word
them prompted me to confirm HTML Conversion and the file looked great. Not a
good solution because I want it automated.

3. Tried making file read-only, changing html file from "foo.htm" to
"foo.html", etc. No dice.

This is frustrating. Can anyone give me a hand?
 
Hello Eric
I am seeing Word 2007 treat HTML files differently when opening through an
automation client (C#) and in Word. Specifically, when I load an html file
that has numbering using Word directly, it automatically senses the file type
and loads it perfectly. When I try to load the same file using Open(), it
flubs the numbering.

Has the HTML file been created in Word itself? How is the numbering
defined in HTML (something like <ul>)?

You might be better off in a newsgroup/forum for automation (read: vba)
and/or numbering.

Numbering in Word _can_ be frustrating, so you are not alone in this ... .-)

..2¢
Robert
 
Thanks Robert.

It appears that Word 2007 can render the same HTML differently depending on
mysterious factors. I ultimately ended up solving my problem another way so
that rendering was consistent.

-Eric
 

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

Back
Top