Hello Ralph,
Concerning Excel, you can find an example in the Genero Desktop Client documentation :
https://4js.com/online_documentation/fjs-gdc-2.10.01-manual-html/User/WinCOM.htmlAs you probably know, The Wincom API is based on VBA, therefore our syntax is really close to this language.
My method (at least with Excel and Word) : recording a macro of what I'm expecting to achieve, and adapting the VBA code to the WinCom functions (mainly with CallMethod and SetProperty).
Now, how does it work with Outlook :
1) Create the Microsoft Outlook objectHow to create the Outlook object in VBA :
Set spObj = CreateObject("Outlook.Application")
How to create the Outlook object in BDL :
##In this whole example, xlapp, xlwb, xlwb2, xlwb3, xlwb4 are the handles.
##They are some integer values which can be used for a later call to the API.
CALL ui.interface.frontcall("WinCOM", "CreateInstance", ["Outlook.Application"], [xlapp])
2) Create object of Outlook (contact, appointment and so on...). Find below the URL which shows the various Microsoft Outlook's objects: http://msdn2.microsoft.com/en-us/library/aa271596(office.11).aspxExample with a
ContactItem object. That would allow you, for example, to automatically add a new contact from a BDL program to Microsoft Outlook :
In VBA :
Set MyItem = spObj.CreateItem(olContactItem)
In BDL:
CALL ui.interface.frontcall("WinCOM", "CallMethod", [xlapp, "CreateItem(olContactItem)"], [xlwb])
3) Display the contact form of Outlook :In VBA :
MyItem.Display
In BDL :
CALL ui.interface.frontCall("WinCOM", "CallMethod", [xlwb, "Display"], [xlwb2])
4) Now, you're probably expecting to file some fields of the contact form (First Name, Name, Address and so on...). In order to achieve this, you have to know the various properties of the object (i.e. : in this case, the ContactItem object). This is also available from the MSDN website from Microsoft : msdn2.microsoft.com/en-us/library/aa210907(office.11).aspx (see the bottom of the page)
Now, you just have to set those properties with the function "SetProperty" of the WinCom API, e.g. :
# First Name
CALL ui.interface.frontCall("WinCOM", "SetProperty", [xlwb, "FirstName", "Lionel"], [xlwb3])
# Email address
CALL ui.interface.frontCall("WinCOM", "SetProperty", [xlwb, "Email1Address", "lif@4js.com"], [xlwb3])
# Business Address
CALL ui.interface.frontCall("WinCOM", "SetProperty", [xlwb, "BusinessAddress", "1 rue de Berne"], [xlwb3])
5) Save your contact form with the "Save" method of the ContactObject (find the methods available at the same URL than the properties): CALL ui.interface.frontCall("WinCOM", "CallMethod", [xlwb, "Save"], [xlwb4])
Of course, this method can be applied to the other objects of the Outlook models (appointment, journal ....). You just have to follow the corresponding MSDN properties and methods.
I hope it helps. Let me know if you need further information.
Best regards,
Lionel