I hope this is a no-brainer. I've found some awesome code that will help me automate outlook, but don't know how in the heck to get it to run. The code is stright from MS, all I need to do is get the thing working. How do you execute a function or sub??? I've look in all the help files like a lost child!
'Dim these objects in module level declarations code
Public gobjOutlook as Outlook.Application
Public gobjNamespace as Outlook.Namespace
Function CreateOutlookInstance() As Boolean
'Create application and namespace root objects
Set gobjOutlook = CreateObject("Outlook.Application.8"
If Err Then
MsgBox "Could not create Outlook Application object!", vbCritical
CreateOutlookInstance = False
Exit Function
End If
Set gobjNameSpace = gobjOutlook.GetNamespace("MAPI"
If Err Then
MsgBox "Could not create MAPI Namespace!", vbCritical
CreateOutlookInstance = False
Exit Function
End If
CreateOutlookInstance = True
End Function
Thanks.
'Dim these objects in module level declarations code
Public gobjOutlook as Outlook.Application
Public gobjNamespace as Outlook.Namespace
Function CreateOutlookInstance() As Boolean
'Create application and namespace root objects
Set gobjOutlook = CreateObject("Outlook.Application.8"
If Err Then
MsgBox "Could not create Outlook Application object!", vbCritical
CreateOutlookInstance = False
Exit Function
End If
Set gobjNameSpace = gobjOutlook.GetNamespace("MAPI"
If Err Then
MsgBox "Could not create MAPI Namespace!", vbCritical
CreateOutlookInstance = False
Exit Function
End If
CreateOutlookInstance = True
End Function
Thanks.