Fivewin OLE with Outlook
Posted: Thu Oct 03, 2019 3:32 pm
All,
I have been using Fivewin to bring up Outlook from 2010 using either of the following functions:
Function GetOutlookObject()
Local oOutlook := Win_OleGetActiveObject( "Outlook.application" )
If oOutlook == nil
oOutlook := Win_OleCreateObject( "Outlook.application" )
Endif
If oOutlook == nil
oOutlook := CreateObject( "Outlook.Application" )
Endif
If oOutlook == nil
MsgStop( "Unable to retrieve the Outlook Application Object...","GetOutlookObject()" )
Endif
Return oOutlook
Function GetOutlookObjectNew()
Local oOutlook := nil
Try
oOutlook := FwGetOleObject( "Outlook.application" )
MsgWait( "Outlook was open by FwGetOleObject!","Info",2 )
Catch
Try
oOutlook := CreateObject( "Outlook.application" )
MsgWait( "Outlook is open now by CreateObject!","Info",2 )
Catch
MsgAlert( "Cannot open outlook" )
End
End
If oOutlook == nil
MsgAlert( "oOutlook is nil" )
Endif
Return oOutlook
Both seem to work great, however when using Outlook from Office 2016 oOutlook is always nil weather attempting to get the active object, or attempting to launch it and then get the object. Anybody know any magic to make the newer one work? Also the print preview in FWH does not seem to launch the new version as well ("@" button).
Thanks in advance,
Byron ...
I have been using Fivewin to bring up Outlook from 2010 using either of the following functions:
Function GetOutlookObject()
Local oOutlook := Win_OleGetActiveObject( "Outlook.application" )
If oOutlook == nil
oOutlook := Win_OleCreateObject( "Outlook.application" )
Endif
If oOutlook == nil
oOutlook := CreateObject( "Outlook.Application" )
Endif
If oOutlook == nil
MsgStop( "Unable to retrieve the Outlook Application Object...","GetOutlookObject()" )
Endif
Return oOutlook
Function GetOutlookObjectNew()
Local oOutlook := nil
Try
oOutlook := FwGetOleObject( "Outlook.application" )
MsgWait( "Outlook was open by FwGetOleObject!","Info",2 )
Catch
Try
oOutlook := CreateObject( "Outlook.application" )
MsgWait( "Outlook is open now by CreateObject!","Info",2 )
Catch
MsgAlert( "Cannot open outlook" )
End
End
If oOutlook == nil
MsgAlert( "oOutlook is nil" )
Endif
Return oOutlook
Both seem to work great, however when using Outlook from Office 2016 oOutlook is always nil weather attempting to get the active object, or attempting to launch it and then get the object. Anybody know any magic to make the newer one work? Also the print preview in FWH does not seem to launch the new version as well ("@" button).
Thanks in advance,
Byron ...