rebol [ Title: "Word formatted table" File: %word-formatted-table.r Date: 29-Jun-2006 Version: 1.0.0 Progress: 0.5 Status: "working" Needs: [] Author: "Anton Rolls" Language: "English" Purpose: {Add formatted text to a Word document} Usage: {} History: [ 1.0.0 [29-Jun-2006 {First version, converted from Benjamin's code} "Anton"] ] ToDo: { - find the original C sample if there is one } Notes: {} ] if error? set/any 'error try [ ; catch all errors 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"] color: to-string to-integer to-binary 255.128.0 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)" "Hello from REBOL."] CallMethod [word_obj ".Selection.TypeParagraph()"] release word_doc release word_obj ] ][ print mold disarm error ]