rebol [
Title: "Word save HTML"
File: %word-save-html.r
Date: 30-Jun-2006
Version: 1.0.0
Progress: 0.6
Status: "working"
Needs: []
Author: "Anton Rolls"
Language: "English"
Purpose: {Create a Word document and have Word save it as HTML.}
Usage: {}
History: [
1.0.0 [30-Jun-2006 {First version, converted from Ben's} "Anton"]
]
ToDo: {
-
}
Notes: {}
]
if error? set/any 'error try [
do/args %../COMLib.r [
; Use the COMLib API functions here
word_obj: createObject "Word.Application"
PutValue [word_obj ".Visible = %s" "TRUE"]
word_doc: GetObject [word_obj ".Documents.Add"]
wdFormatHTML: 8
color: to-string to-integer to-binary reverse 0.128.255
PutValue [word_obj ".Selection.Font.Size = %s" "20"]
PutValue [word_obj ".Selection.Font.SmallCaps = %s" "1"]
PutValue [word_obj ".Selection.Font.Name = %s" "Comic Sans MS"]
PutValue [word_obj ".Selection.Font.Color = %s" color]
CallMethod [word_obj ".Selection.TypeText(%s)" join "Writing to HTML !^/" system/license]
CallMethod [word_doc ".SaveAs(%s,%d)" to-local-file clean-path %demos/testdoc.html wdFormatHTML]
release word_doc
release word_obj
]
][
print mold disarm error
]