Information générale
Catégorie:
COM/DCOM et OLE Automation
Now I'm getting somewhere. I went to several machines that had Word97 installed and opened a document and then saved it as a HTML file. This is the typical macro I would see recorded:
ActiveDocument.SaveAs
FileName:="test.htm",
FileFormat:=100,
LockComments =False....etc.
The key is that on my machine, it recorded "100" as the "FileFormat", but on others it recorded either "102" or "114". On Word2000, it recorded "wdFormatHTML".
I've tried looking at the registry for these values (looking for "HTML32"), but haven't found anything yet.
Any clues?
Don
>>I'm opening "template" documents in Word, substituting data using bookmarks, and then writing the data out as an HTML file (for preview) or a DOC file (for actual printing).
>>
>>The problem is that sometimes the HTML output works fine (properly formatted tables, font characteristics, etc.) but at other times it produces "plain" ASCII text - no HTML formatting whatsoever. The problem seems to depend on the actual installation of Word97 on each machine.
>>
>>Anybody seen this?
>>
>>The code looks something like this:
>>
>> llLockComments = .F.
>> lcPassword = ""
>> llAddToRecentFiles = .F.
>> lnFormat = 100
>> lcOutfile = "foobar.htm"
>> loWord.Application.ActiveDocument.SaveAs(lcOutFile, lnFormat, llLockComments, lcPassword, llAddToRecentFiles)
>>
>>Note that the value of "100" for the format was obtained by performing the same task manually with the Macro Recorder on. If I try this in Word2000, I use a value of "8" (wdFormatHTML). I haven't repeated this experiment with Word2000, since its not installed on several machines (yet).
>>
>>Thanks for any help...
>>
>>Don
>
>I would first chack that the HTML convertor was installed on the suspect machines.
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement