Page History
...
*
*Enable and show controls in the Data for New Document group box
set com(#gpbx_3 #labl_2) enabled(true)
execute infmessage 'A new document has been opened.'
*Update the list of documents
execute doclist
*disable the Add Document button until the employee information has been inserted
set #addbtn enabled(false)
ENDROUTINE
*Add employee information to the document
EVTROUTINE HANDLING(#ltvw_1.DoubleClick)
*Concatenate first name and surname to get #Fullname
Use BConcat (#GiveName #SurName) (#FullName)
*Locate the Word bookmark 'fullname' in the document
invoke method(#WordDoc.Bookmarks.item<'fullname'>.select)
*Insert the value of the #fullname field
invoke method(#WordApp.Selection.TypeText) text(#fullname)
invoke method(#WordDoc.Bookmarks.item<'address1'>.select)
invoke method(#WordApp.Selection.TypeText) text(#address1)
invoke method(#WordDoc.Bookmarks.item<'address2'>.select)
invoke method(#WordApp.Selection.TypeText) text(#address2)
invoke method(#WordDoc.Bookmarks.item<'address3'>.select)
invoke method(#WordApp.Selection.TypeText) text(#address3)
invoke method(#WordDoc.Bookmarks.item<'postcode'>.select)
use numeric_string #postcode #std_texts
invoke method(#WordApp.Selection.TypeText) text(#std_texts)
invoke method(#WordDoc.Bookmarks.item<'phonehme'>.select)
invoke method(#WordApp.Selection.TypeText) text(#phonehme)
invoke method(#WordDoc.Bookmarks.item<'phonebus'>.select)
invoke method(#WordApp.Selection.TypeText) text(#phonebus)
invoke method(#WordDoc.Bookmarks.item<'writernam'>.select)
invoke method(#WordApp.Selection.TypeText) text(#WordApp.UserName)
invoke method(#WordDoc.Bookmarks.item<'homepage'>.select)
invoke method(#WordApp.Selection.TypeText) text(www.lansa.com)
invoke method(#WordDoc.Bookmarks.item<'fulldate'>.select)
invoke method(#WordApp.Selection.TypeText) text(#datec)
*Get the skills information for the employee and add it to the working list #skills
Select *all From_File(PslSkl) with_Key(#Empno)
Fetch #SkilDesc from_File(SklTab) With_Key(#SkilCode) Keep_Last(50)
Add_Entry #Skills
EndSelect
invoke method(#WordDoc.Bookmarks.item<'skills'>.select)
Selectlist #skills
*Insert the value of the #skilcode field
invoke method(#WordApp.Selection.TypeText) text(#skilcode)
*Move cursor right to the next table cell
invoke method(#wordapp.Selection.MoveRight) Unit(1) Count(1)
invoke method(#WordApp.Selection.TypeText) text(#skildesc)
invoke method(#wordapp.Selection.MoveRight) Unit(1) Count(1)
invoke method(#WordApp.Selection.TypeText) text(#grade)
invoke method(#wordapp.Selection.MoveRight) Unit(1) Count(1)
invoke method(#WordApp.Selection.TypeText) text(#comment)
invoke method(#wordapp.Selection.MoveRight) Unit(1) Count(1)