Get full path for attachment on MailItem.AttachmentAdd event
I am baffled by my inability to get a full path for an attachment. In my class module I trap the oMailItem.AttachmentAdd event, but I cannot seem to be able to get the path, it is always empty. I think it should be available for the Outlook.Attachment object, right? Maybe in the fields collection?
Thank you very much
Re: Get full path for attachment on MailItem.AttachmentAdd event
It could be possible that the attachment filepath is empty because of two reasons. One, it may not be updated until after the event fires. Two, it could be because when its added its actually embedded internally and will not contail a regular file path. ;)
Re: Get full path for attachment on MailItem.AttachmentAdd event
Thanks for your reply RobDog. After further research I'm still confused –the CDO Attachment object has a source property and you can get to it (apparently, haven't actually tried it) but the Outlook Attachment object doesn’t? Also tried to use the fields collection (to get to the MAPI PR_ATTACH_PATHNAME –used the &H3708001E value), but no luck either. Just seems curious to me that nobody had a need for this until now….
When you say embedded internally do you mean extended MAPI?
Thanks again, Gicu
Re: Get full path for attachment on MailItem.AttachmentAdd event
Yes, internally. For ex. when it attaches it copies the file to the temp directory for embedding before the send. If you look at the header of an email with attachments you may see what I mean. ;)
I'll see if there is something using CDO since I didnt know you had it available to you. ;)