Modify ↓
Opened 10 years ago
Closed 10 years ago
#3263 closed Bug (No Bug)
DocSaveAs does not output HTML file properly
| Reported by: | Owned by: | ||
|---|---|---|---|
| Milestone: | Component: | AutoIt | |
| Version: | 3.3.14.0 | Severity: | None |
| Keywords: | Cc: |
Description
The output of xlabs.html is a text file in IE/Chrome/Firefox, it seems HTML header information is missing.
Local $oAppl1 = _Word_Create()
$Filehandle = _Word_DocOpen($oAppl1, "
fred\xlabs.docx",Default, Default, True)
If @error = 1 Then
MsgBox(0, "FAILURE!", "Unable to Create the WORD Object")
Exit
ElseIf @error = 2 Then
MsgBox(0, "FAILURE!", "File xlabs Status Report does not exist")
Exit
EndIf
_Word_DocSaveAs($Filehandle,$TimelineFilePath & "\xlabs.html")
If @error Then MsgBox(0, "FAILURE", " Status Report was NOT Saved!", 3)
_Word_DocClose($Filehandle)
Attachments (0)
Note:
See TracTickets
for help on using tickets.

You're not saving it as an HTML file with that code, you're saving it as a Word document. Just because you name it with an HTML extension doesn't mean that it's going to save it as HTML. You need to add the file format parameter if you're saving it as something other than a Word document, in this case you need to use $WdFormatHTML as the file format parameter.