Copying Attachments

  • Thread starter Thread starter mookashi
  • Start date Start date
M

mookashi

hi,
iam trying to copy an attachment from mailitem to another.

while attaching the file to the original mailitem is no problem
-using the Attachments.Add(filename with the full path)--
i dont know how to copy the this attachment to a diff mailitem
the code is as below

here objmailitemcopy and objcurrentmail are of type Outlook.mailItem

For ctrNoOfAttachments = 1 To objMailItemCopy.Attachments.Count
Set oAttach = objCurrentMail.Attachments.Add _
(objMailItemCopy.Attachments.Item(ctrNoOfAttachments).filename)
Next

Can anyone help please??
 
hi,
iam trying to copy an attachment from mailitem to another.

while attaching the file to the original mailitem is no problem
-using the Attachments.Add(filename with the full path)--
i dont know how to copy the this attachment to a diff mailitem
the code is as below

here objmailitemcopy and objcurrentmail are of type Outlook.mailItem

For ctrNoOfAttachments = 1 To objMailItemCopy.Attachments.Count
Set oAttach = objCurrentMail.Attachments.Add _
(objMailItemCopy.Attachments.Item(ctrNoOfAttachments).filename)
Next

Can anyone help please??



Report this post to a moderator | IP: Logged

02-11-2004 10:02 AM



Sue Mosher [MVP]
Guest

Registered: Not Yet
Location:
Posts: N/A
Re: Copying Attachments
You must save the attachments first. See
http://www.slipstick.com/dev/code/copyatts.htm for sample code.
--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers







hi,
thanks it was very helpful
 
You cannot directly manipulate the attachments that way. You'd have to
save the attachments from the first item to the file system and then
attach them to the second item from the file system the way you added
them to the first item.
 
Back
Top