V
Vinay Singh
My prob is that i am trying to send a mail content to a
distribution list in my address book. I am not sending it
manually because i want to send to them one by one and
also introduce a sleep time between each sent.
Error that I get -
"messaging interface has returned unknown error microsoft
outlook"
Code that I am using -
Sub abc()
Set myOlApp = CreateObject("Outlook.Application")
Set myNameSpace = myOlApp.GetNamespace("MAPI")
Set myFolder = _
myNameSpace.GetDefaultFolder(olFolderContacts)
Set myGAddressList = myNameSpace.AddressLists("Contacts")
Set myGEntry = myGAddressList.AddressEntries("GLT")
(I GET ERROR ON FOLLOWING LINE)
For Each xMember In myGEntry.Members
MsgBox xMember
Next
Set myDraftFolder = myNameSpace.GetDefaultFolder
(olFolderDrafts)
Set myMailItem = myDraftFolder.Items("Not much for a xyz
Career")
Set myMailItemCopy = myMailItem.Copy
For Each Item In myItem
myMailItemCopy.To = "x"
myMailItemCopy.Send
Next
End Sub
distribution list in my address book. I am not sending it
manually because i want to send to them one by one and
also introduce a sleep time between each sent.
Error that I get -
"messaging interface has returned unknown error microsoft
outlook"
Code that I am using -
Sub abc()
Set myOlApp = CreateObject("Outlook.Application")
Set myNameSpace = myOlApp.GetNamespace("MAPI")
Set myFolder = _
myNameSpace.GetDefaultFolder(olFolderContacts)
Set myGAddressList = myNameSpace.AddressLists("Contacts")
Set myGEntry = myGAddressList.AddressEntries("GLT")
(I GET ERROR ON FOLLOWING LINE)
For Each xMember In myGEntry.Members
MsgBox xMember
Next
Set myDraftFolder = myNameSpace.GetDefaultFolder
(olFolderDrafts)
Set myMailItem = myDraftFolder.Items("Not much for a xyz
Career")
Set myMailItemCopy = myMailItem.Copy
For Each Item In myItem
myMailItemCopy.To = "x"
myMailItemCopy.Send
Next
End Sub