So what? Just set MyMailItem.To.

Signature
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx
> Sue,
> When I use 'Copy' method, there might be a lot of recipients in UserMailItem
[quoted text clipped - 6 lines]
> >
> > Then change the recipients for MyMailItem as needed and send.
> > > Hi,
> > > I have written an application that opens a new mail item for the user
[quoted text clipped - 14 lines]
> > > Thanks!
> > > Amin
Amin Sobati - 10 Jun 2004 15:17 GMT
Thanks Sue,
Another problem is that when I use 'Copy', a blank(empty) email is generated
per each MailItem that I create. This is my code written in ItemSend event:
Private Sub OA_ItemSend(ByVal Item As Object, Cancel As Boolean)
Dim R As Recipient
Dim tmpMail As MailItem
For Each R In Item.Recipients
Set tmpMail = OA.CreateItem(olMailItem)
Set tmpMail = tmpMail.Move(NS.GetDefaultFolder(olFolderOutbox))
Set tmpMail = Item.Copy
'Emptying the recipients:
For i = 1 To tmpMail.Recipients.Count
tmpMail.Recipients.Remove 1
Next
'Add the email address:
tmpMail.Recipients.Add R
Set objSafeMail = CreateObject("Redemption.SafeMailItem")
tmpMail.Save
Set objSafeMail.Item = tmpMail
objSafeMail.Send
Next
End Sub
Thank you again,
Amin
> So what? Just set MyMailItem.To.
>
[quoted text clipped - 36 lines]
> > > > Thanks!
> > > > Amin
Sue Mosher [MVP-Outlook] - 10 Jun 2004 16:52 GMT
These statements create a blank email message and try to move it to the
Outbox. You don't need them:
> Set tmpMail = OA.CreateItem(olMailItem)
> Set tmpMail = tmpMail.Move(NS.GetDefaultFolder(olFolderOutbox))

Signature
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx
> Thanks Sue,
> Another problem is that when I use 'Copy', a blank(empty) email is generated
[quoted text clipped - 64 lines]
> > > > > Thanks!
> > > > > Amin