M
Mr. Cheeks
Hello!
I hope you can help me correctly run this VBA script. I'm trying to run a
script in Excel that will display information from my Outlook contacts. I
tried to follow examples on this site, but I'm running into problems
accessing the contact folder.
I'm running Outlook & Excel 2003, Windows XP, and my work has an exchange
server but I'm not sure how this complicates things.
Thanks so much! Let me know if I can provide any more info.
Sub ShowContactNames ()
Set OutApp = CreateObject("Outlook.Application")
Set myNameSpace = OutApp.GetNamespace("MAPI")
Set myFolder = myNameSpace.GetDefaultFolder(olFolderContacts) 'It errors out
on this line
Set myContacts = myFolder.Items
For Each myContact In myContacts
MsgBox "Name = " & myContact.FullName
Next
MsgBox "You Rock!"
End Sub
Error out on line "Set myFolder = myNameSpace..."
"Run-Time error '-2147024809 (80070057)': Could not complete the operation.
One or more parameter values are not valid."
Help me MVPs, you're my only hope!
I hope you can help me correctly run this VBA script. I'm trying to run a
script in Excel that will display information from my Outlook contacts. I
tried to follow examples on this site, but I'm running into problems
accessing the contact folder.
I'm running Outlook & Excel 2003, Windows XP, and my work has an exchange
server but I'm not sure how this complicates things.
Thanks so much! Let me know if I can provide any more info.
Sub ShowContactNames ()
Set OutApp = CreateObject("Outlook.Application")
Set myNameSpace = OutApp.GetNamespace("MAPI")
Set myFolder = myNameSpace.GetDefaultFolder(olFolderContacts) 'It errors out
on this line
Set myContacts = myFolder.Items
For Each myContact In myContacts
MsgBox "Name = " & myContact.FullName
Next
MsgBox "You Rock!"
End Sub
Error out on line "Set myFolder = myNameSpace..."
"Run-Time error '-2147024809 (80070057)': Could not complete the operation.
One or more parameter values are not valid."
Help me MVPs, you're my only hope!