D
David Every
Hi , I am generating a Word 2003 document using VBScript
similar to the following:
' Create an instance of Word
Set wrdApp = CreateObject("Word.Application")
wrdApp.Visible = True
' Add a new document
Set wrdDoc = wrdApp.Documents.Add
wrdDoc.PageSetup.Orientation = wdOrientPortrait
wrdDoc.Select
Set wrdSelection = wrdApp.Selection
wrdDoc.Select
' Create a string and insert it into the document
StrToAdd = "Release Note"
wrdSelection.Font.Name
= "Arial"
wrdSelection.Font.Size = 12
wrdSelection.Font.Bold = True
StrToAdd = "Build Information"
wrdSelection.ParagraphFormat.Alignment =
0 'wdAlignParagraphLeft
wrdSelection.TypeText StrToAdd
'now save it as MHTML
wrdDoc.SaveAs "C:\Temp\Dev\BuildReleaseNotes.mhtml",10
' I have also tried
wrdDoc.SaveAs "C:\Temp\Dev\BuildReleaseNotes.mhtml",8
But the resulting mhtml file is not in the correct MHTML
format, I would like to know how to emulate the Word ->
File -> Save As -> Web Archive (*.mht, *.mhtml) function
in VBScript.
Any help much appreciated.. thanks in advance
Regards
David E
similar to the following:
' Create an instance of Word
Set wrdApp = CreateObject("Word.Application")
wrdApp.Visible = True
' Add a new document
Set wrdDoc = wrdApp.Documents.Add
wrdDoc.PageSetup.Orientation = wdOrientPortrait
wrdDoc.Select
Set wrdSelection = wrdApp.Selection
wrdDoc.Select
' Create a string and insert it into the document
StrToAdd = "Release Note"
wrdSelection.Font.Name
= "Arial"
wrdSelection.Font.Size = 12
wrdSelection.Font.Bold = True
StrToAdd = "Build Information"
wrdSelection.ParagraphFormat.Alignment =
0 'wdAlignParagraphLeft
wrdSelection.TypeText StrToAdd
'now save it as MHTML
wrdDoc.SaveAs "C:\Temp\Dev\BuildReleaseNotes.mhtml",10
' I have also tried
wrdDoc.SaveAs "C:\Temp\Dev\BuildReleaseNotes.mhtml",8
But the resulting mhtml file is not in the correct MHTML
format, I would like to know how to emulate the Word ->
File -> Save As -> Web Archive (*.mht, *.mhtml) function
in VBScript.
Any help much appreciated.. thanks in advance
Regards
David E