Hi all,
I have some components written several years ago with which you can create emails by interfacing Outlook.
When I developed the components, the Microsoft library available for Office 2010 was version 14.
Of course Office has changed in the meantime and now the available library is version 16.
It is not a problem to change the Outlook signatures in Uniface to use the new library but a problem exists when old and new versions of Office coexist within the same company installation.
It is not a big problem to insert in the forms that interface with Outlook some controls linked in some way to each individual user to check which library is available in his workstation but, if possible, I would like to avoid it.
In VBA these things can be solved with the Late Binding technique with which you work with Objects to create application instances (Excel, Outlook and so on).
The standard Early Binding technique is exactly the one that is currently available with Uniface with which Outlook instances are created through the interfacing allowed by its signatures that have been previously imported.
Are there alternatives that allow you to avoid 'worrying' about the version of Office present in the workstation?
If it may be useful to report one of the many examples in VBA found on the Internet of the two techniques I have described:
============================================================
Early Binding ------------------------
'~~> Set reference to Excel Object Library Sub Sample() Dim oXLApp As Excel.Application Dim oXLBook As Excel.Workbook Dim oXLSheet As Excel.Worksheet '~~> Create a new instance of Excel Set oXLApp = New Excel.Application '~~> Add a new workbook Set oXLBook = oXLApp.Workbooks.Add Set oXLSheet = oXLBook.Worksheets(1) ' '~~> Rest of the code ' End Sub
============================================================
Late Binding ----------------------
'~~> Doesn't require a reference to Excel Object Library
Sub Sample()
Dim oXLApp As Object
Dim oXLBook As Object
Dim oXLSheet As Object
'~~> Create a new instance of Excel
Set oXLApp = CreateObject("Excel.Application")
'~~> Add a new workbook
Set oXLBook = oXLApp.Workbooks.Add
Set oXLSheet = oXLBook.Worksheets(1)
'
'~~> Rest of the code
'
End Sub
============================================================
Many thanks
Luigi



