C
Cole
Hi folks,
I don't do much with VBA, so any explicit help is greatly appreciated.
I'm trying to push a button in Excel and have it:
I've looked at several postings in this group and tried some stuff, but
nothing seems to work, thus far. Here is what I tried (Commented out
cause it didn't work.) So feel free to ignore the code snippits I've
found. (I could also use a suggestion on a really good book on
programming in VB and/or VBA for a programmer coming from a totally
different paradigm.)
'Dim IsItRunning As Boolean
' On Error Resume Next
' whichprogram = GetObject(, "Outlook.Application")
' If whichprogram = "Outlook" Then IsItRunning = True Else
IsItRunning = False ' <== This stmt did not work.
' Err.Clear
' If WhichProgram = "Outlook" Then IsItRunning = True
' If IsItRunning = False Then
' Dim RetVal
' RetVal = Shell("C:\Program Files\Microsoft
Office\Office11\Outlook.EXE", 6)
' End If
AND I TRIED THE FOLLOWING:
' Dim objOutlook As Object
' Dim objPhonelist As Object
' Dim olNameSpace As Object
'''Set the reference to the Outlook object model
' On Error Resume Next
' ThisWorkbook.VBProject.References.AddFromFile Application.Path & _
' "\00SVO\Company Directory\Company Phone Numbers"
' On Error GoTo 0
'''Create the Outlook object
' Set objOutlook = CreateObject("Outlook.Application")
'''Get Outlook's work area
' Set olNameSpace = objOutlook.GetNamespace("MAPI")
'''Access and display the default Inbox folder
' Set objPhonelist = olNameSpace.GetDefaultFolder(objPhonelist)
' objInbox.Display
Thank you in advance for your help.
Kind regards,
Cole
I don't do much with VBA, so any explicit help is greatly appreciated.
I'm trying to push a button in Excel and have it:
See if Outlook is already started. If not - start it up.
Change focus to the Outlook Contacts page.
I've looked at several postings in this group and tried some stuff, but
nothing seems to work, thus far. Here is what I tried (Commented out
cause it didn't work.) So feel free to ignore the code snippits I've
found. (I could also use a suggestion on a really good book on
programming in VB and/or VBA for a programmer coming from a totally
different paradigm.)
'Dim IsItRunning As Boolean
' On Error Resume Next
' whichprogram = GetObject(, "Outlook.Application")
' If whichprogram = "Outlook" Then IsItRunning = True Else
IsItRunning = False ' <== This stmt did not work.
' Err.Clear
' If WhichProgram = "Outlook" Then IsItRunning = True
' If IsItRunning = False Then
' Dim RetVal
' RetVal = Shell("C:\Program Files\Microsoft
Office\Office11\Outlook.EXE", 6)
' End If
AND I TRIED THE FOLLOWING:
' Dim objOutlook As Object
' Dim objPhonelist As Object
' Dim olNameSpace As Object
'''Set the reference to the Outlook object model
' On Error Resume Next
' ThisWorkbook.VBProject.References.AddFromFile Application.Path & _
' "\00SVO\Company Directory\Company Phone Numbers"
' On Error GoTo 0
'''Create the Outlook object
' Set objOutlook = CreateObject("Outlook.Application")
'''Get Outlook's work area
' Set olNameSpace = objOutlook.GetNamespace("MAPI")
'''Access and display the default Inbox folder
' Set objPhonelist = olNameSpace.GetDefaultFolder(objPhonelist)
' objInbox.Display
Thank you in advance for your help.
Kind regards,
Cole