0

when having email Messages open in Outlook 2013 (in reading mode) that I'd like to Forward to somebody else as an embedded attachment, i always have to find the original mail again before being able to attach it in a new or existing message or appointment or ...

Much like the 'Forward as attachment'-button under 'home > message > respond > more > Forward as attachment' I'd like to copy the current mail to the clipboard. This way i can add the object to any new Messages/appointments/etc.

Other Forum entries only copy the Body of the mail e.g.:

I'd like to have the complete object in though.

is there anybody that can help me finding the correct Expression for that? i figured if i Change the "M.HTMLBody" in the below code to something like object I'd be golden.

Sub Test()
    Dim M As MailItem, Buf As MSForms.DataObject

    Set M = ActiveExplorer().Selection.item(1)
    Set Buf = New MSForms.DataObject
    Buf.SetText M.HTMLBody
    Buf.PutInClipboard

End Sub

many thanks in advance!

Bob
  • 13
  • 7

1 Answers1

0

Why would you want to copy anything to the clipboard? You can attach any message to another message by calling MailItem.Attachments.Add.

Dmitry Streblechenko
  • 62,942
  • 4
  • 53
  • 78
  • because it's not always to a new mail-message, but sometimes to other appointments, OneNote, etc. – Bob Jun 29 '17 at 11:56
  • Appointments allow to add embedded message attachments in exactly same way - AppointmentItem.Attachments.Add(YourMailItem). – Dmitry Streblechenko Jun 29 '17 at 13:23
  • the Point is that I'd like the flexibility to create one button and then have the message on the clipboard. afterwards i could then decide whether I'd like it in an appointment, in a document, in a PowerPoint slide or wherever. also: i don't want to start off with a completely new email or appointment, but also have the possibility to paste multiple open Messages into one. therefore the clipboard functionality would fit perfectly. – Bob Jun 29 '17 at 13:57
  • You can do that, but the users don't generally appreciate when their clipboard is wiped out/replaced. To use the clipboard, you would need to hack the private clipboard format used by Outlook when an item is copied to the clipboard. – Dmitry Streblechenko Jun 29 '17 at 15:35
  • For the clipboard format, see https://github.com/yasoonOfficial/outlook-dndprotocol – Dmitry Streblechenko Jun 29 '17 at 15:35
  • i wouldn't mind all too much about that since I'd conciously press the button to save it to the clipboard (I'd almost use ctrl-c shortcut for it if it wouldn't have interfered with the other functionality of this oh-so-wonderful shortcut :-) in any case thanks for the hint, will have a look whether i manage to solve my Problem using it! – Bob Jun 29 '17 at 16:21