Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Word97 and HTML output
Message
De
12/11/1999 13:39:17
Donald Krasnick
Stanton Systems and Consulting
Havertown, Pennsylvanie, États-Unis
 
 
À
12/11/1999 12:55:11
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00289845
Message ID:
00290675
Vues:
11
>The literal value of the constant wdFormatHTML is 8. You can find the values of Office constants in the VBA editor's object browser, by typing in the name of the constant in the search window.
>

Yeah, I know - but that only applies to Word 2000. The macro below is LITERALLY what Word97 is creating - I didn't "translate" "wdFormatHTML" to "100" for this message. On other machines, it literallys records "102" or "114".

Go figure....

Don




>
>>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
Répondre
Fil
Voir

Click here to load this message in the networking platform