#! ********************************************************************************************* #! This code is hereby placed in the public domain and may be freely used to assist with the #! development of Clarion applications. If you find bugs, have changes or suggestions to #! make about this template, please send them to email: brent@magicom.co.nz #! #! The purpose of the template is to generate a single function that accepts the name of a #! document as its parameter. It returns LEVEL:Benign, LEVEL:Notify or LEVEL:Fatal #! #! Providing MSWORD is running, it will issue a "PRINT" command to MSWORD for the passed #! document and then sit in an ACCEPT() loop acting as a DDE server for MSWORD. #! #! The MSWORD document should be formatted to contain fields where data from the Clarion #! application will be placed. These are standard word fields in the format: #! #! {DDE %application DATA %field} #! #! where . {} are the standard MSWORD "field" curly braces #! . %application is replaced with the name of your application #! . DATA is typed "as is" and represents the topic #! . %field is the selected field from the Clarion application files #! caveat this MUST be a word field, just typing the plain text will NOT work!! #! #! The last MSWORD field should be {DDE %application DATA EXIT}. The procedure will #! recognise the EXIT keyword and terminate the ACCEPT() loop. A timeout can be used in #! addition to this, specify the number of seconds to wait - I have found 5 is good! #! #! Other Features: #! o You can have the procedure display a status screen to the user and optionally specify #! which fields it is processing. #! o It will also generate a %Procedure.FLD text file which provides the user with a list #! of all the fields that can be used, along with descriptions. #! o You can use ALL the bindable files you have defined in your dictionary or just those #! that you select via the "Files" button on the procedure properties screen. #! #! TO CALL FROM CLARION (Button or Code): #! Variable = 'C:\My Documents\My document.doc' #! If procedure(variable) #! Document Print failed #! Else #! Document Print succeeded #! End #! #! The generated code is reasonably self documenting, although I have sprinkled comments #! around the place, contray to DAB's philosophy. I APPRECIATE FEEDBACK AS WE ALL DO! #! #! ENJOY your work - Brent Stock #! Magicom International Ltd #! Christchurch, New Zealand #! email: brent@magicom.co.nz #! #! ********************************************************************************************* #! #! Wish list that someone may get around to and send back to me: #! #! 1. Autostart MSWORD if it is not running and avoid my cancel message #! 2. Change DDE stuff to OLE where it can be changed (unsure about the ACCEPT() loop and DDE) #! 3. Any other little things that would help. #! #! If any of these do happen, I will repost it to the public domain so everyone can share it. #! #! *********************************************************************************************