D
Daniel.Peaper
Hi All,
Can someone help me with, what I'm sure will turn out to be a straight
forward problem? I am trying to send a message to a contact
automatically. For simplicity, as I am learning Outlook VBA, I have
one message in the inbox and one contact.
Using Sue Mosher's excellent book Microsoft outlook Programming I have
arrived at the following code:
Private Sub processMail()
Dim myNS As Outlook.NameSpace
Dim objContacts As Outlook.MAPIFolder
Dim objContact As Outlook.ContactItem
Dim objInbox As Outlook.MAPIFolder
Dim myMessage As Outlook.MailItem
Dim objNewMail As Outlook.MailItem
Dim objSafecontact As Redemption.SafeContactItem
Dim objSafeNewMail As Redemption.SafeMailItem
Set myNS = GetNamespace("MAPI")
Set objContacts = myNS.GetDefaultFolder(olFolderContacts)
Set objContact = objContacts.Items.GetFirst
Set objSafecontact = CreateObject("Redemption.SafeContactItem")
objSafecontact.Item = objContact
Set objInbox = myNS.GetDefaultFolder(olFolderInbox)
Set myMessage = objInbox.Items.GetFirst
Set objNewMail = myMessage.Forward
objNewMail.To = objSafecontact
Set objSafeNewMail = CreateObject("Redemption.SafeMailItem")
objSafeNewMail.Item = objNewMail
objSafeNewMail.Send
End Sub
However, instead of sending my mail it goes into the Drafts Folder and
I cannot figure out why? I might add that the contact that I want to
send it to is a fax recipient but I have tried changing them to an
eMail recipient but it makes no difference - Drafts(1)
I'm running Outlook XP and Redemption 4.4.0.714
Cheers,
Danny
Can someone help me with, what I'm sure will turn out to be a straight
forward problem? I am trying to send a message to a contact
automatically. For simplicity, as I am learning Outlook VBA, I have
one message in the inbox and one contact.
Using Sue Mosher's excellent book Microsoft outlook Programming I have
arrived at the following code:
Private Sub processMail()
Dim myNS As Outlook.NameSpace
Dim objContacts As Outlook.MAPIFolder
Dim objContact As Outlook.ContactItem
Dim objInbox As Outlook.MAPIFolder
Dim myMessage As Outlook.MailItem
Dim objNewMail As Outlook.MailItem
Dim objSafecontact As Redemption.SafeContactItem
Dim objSafeNewMail As Redemption.SafeMailItem
Set myNS = GetNamespace("MAPI")
Set objContacts = myNS.GetDefaultFolder(olFolderContacts)
Set objContact = objContacts.Items.GetFirst
Set objSafecontact = CreateObject("Redemption.SafeContactItem")
objSafecontact.Item = objContact
Set objInbox = myNS.GetDefaultFolder(olFolderInbox)
Set myMessage = objInbox.Items.GetFirst
Set objNewMail = myMessage.Forward
objNewMail.To = objSafecontact
Set objSafeNewMail = CreateObject("Redemption.SafeMailItem")
objSafeNewMail.Item = objNewMail
objSafeNewMail.Send
End Sub
However, instead of sending my mail it goes into the Drafts Folder and
I cannot figure out why? I might add that the contact that I want to
send it to is a fax recipient but I have tried changing them to an
eMail recipient but it makes no difference - Drafts(1)
I'm running Outlook XP and Redemption 4.4.0.714
Cheers,
Danny