Userobjectpbwword

Library :     C:\D\PBWLibrarys\Testpbd\pbwword.pbl
Date:          29/10/2004 5.05.50
Comment: 


Specifications, notes, comments on pbwword
//MICROSOFT WORD WRAPPER

This object is makes easy to use Word Automation for PB applications.



THIS SOFTWARE AND THE ACCOMPANYING FILES ARE DISTRIBUTED "AS IS" AND WITHOUT WARRANTIES 




Functions:
public function string f_array_string (any array[])public function string f_array_string (any array[])
f_string_arraypublic subroutine f_string_array (string arg_string, ref string arg_arr[], string arg_separator)
wa_activatepublic subroutine wa_activate ()
wa_initializeInitialize the component
public function long wa_isactive (long arg_start)Returns 0 if word is not active. If arg_start > 0 starts word
wa_listalldocfilesFind all word documents in a folder. Set arg_subfolder = 1 to scan subfolders
wa_moveandresizewindowTo set position of Word window
wa_quitwordQuit Word and optionally saves the open documents
wa_templatemodifiedIf you want to set the template dirty, set arg_mod 0. Use this function after you have modified Word menu or toolbar. You must specify the full name for arg_template, if you refer to the normal template use only Normal.dot.
wd_closealldocumentsCloses all documents
wd_closedocumentCloses the specified document or the active document if the specified document dosen't exist
wd_displaydialogDisplays the specified built-in dialog box until the user closes it.
wd_displayexecutedialogDisplays execute dialog
wd_displayhelpaboutDisplays help-about dialog
wd_displayspellcheckdialogDisplays spellcheck dialog
wd_displayuserinfodialogDisplays user info dialog
wd_getdocumentrangeIs usedto get starting and ending position of the document.
public function string wd_newdoc (string arg_template, string arg_filename)Create new word file based on arg_tempate if it exists or on Normal.dot. arg_filename is not used at the moment
public function string wd_opendoc (string wordfile, s_open_options options)Opens word file some parameterscan be specified using options parameter
public function string wd_openfile (string wordfile)Opens word file
wd_pasteOpens word file
wd_savealldocspublic subroutine wd_savealldocs (long arg_prompt)
wd_saveasdocumentSaves specified document
wd_savedocumentOpens word file
public function integer wd_searchandreplaceinrange (string arg_h_file, string arg_find, string arg_replace, long arg_start, long arg_end)Search and replace function.
public function long wd_spellcheckstring (string arg_string)Return 1 if arg_stirng is correct 0 otherwise
wd_textinsertInsert text at the specified position
wd_textsubstituteReplace the text between arg_star and arg_end with arg_txt
wd_visiblepublic subroutine wd_visible (boolean arg_visible)
wm_addbuttontotoolbarAdd a button to a tooolbar arg_toolbar = existing toolbar name arg_name = button name arg_id = button id, use 0 to add a new button, if you know the id of an existing button you can use it arg_tooltip = button tooltip arg_bmp = button image
wm_addcmbtotoolbarpublic subroutine wm_addcmbtotoolbar (string arg_toolbar, string arg_name, string arg_tooltip)
wm_addwordbuttonmenubarpublic subroutine wm_addwordbuttonmenubar (long x_pos, long y_pos, string caption, string buttonname, string filebmp, long beginnewgroup)
wm_addwordmenubarpublic subroutine wm_addwordmenubar (long x_pos, long y_pos, string caption)
wm_addwordtoolbarpublic subroutine wm_addwordtoolbar (string arg_name)
wm_cmbaddAdd items to combo box control. Use toolbar and control name to find the right control. Control type must be ComboBox
public function string wm_cmbgettext (string arg_toolbar, string arg_cmb)Add items to combo box control. Use toolbar and control name to find the right control. Control type must be ComboBox
ws_getselectionGet selection
ws_inserttextatselectionInserts text at selection
ws_selectionstartend Position/Select the the insertion point at the beginning or at the end of the document moveType = 0 -> move moveType = 1 -> extend arg_extend = 0 -> start of the document arg_extend = 1 -> end of the document

Events:
pbw_quitOccurs when the user quits word
pbm_eventevent pbm_event
pbw_documentopenOccurs when a documet is opened. arg_doc: the document that's being opened
pbw_documentchangeWord fires this event when ActiveDocument is changed
pbw_documentsaveOccurs when a documet is saved. arg_doc: the document that's being saved
pbw_documentprintOccurs when a documet is printed. arg_doc: the document that's being printed
pbw_btnclikedevent pbw_btncliked(s_docs arg_docs, string btnname)
pbw_documentcloseOccurs when document is closed
pbw_documentnewOccurs when a new documet is created. arg_doc: the new document
pbw_changeevent pbw_change()
pbw_cmbchangeevent pbw_cmbchange()
constructorevent constructor
destructorevent destructor