Need to create macro that will add sticky notes to email RRS feed

  • Question

  • Hopefully this is as simple and straight-forward as I think it will be.  My job requires me to place hardware and software orders for several of our clients, and I need an easy way to attach sticky notes to order confirmation emails I receive. 

    My problem now is that I receive order/payment/shipping confirmation emails from places like Amazon, but then I have a hard time remembering which client I ordered them for, or which order belongs to what client.  So I'm constantly following the same process with incoming emails:  open item, edit message, insert, attach outlook item, scroll to notes, and find the client name I created as a note.

    Can someone help me create a code for this process so I can make a macro?   

    Thursday, January 16, 2014 7:28 PM


  • Hello RubberBucket,

    It looks like you need to use the Add method of the Attachments class for embedding notes to the Outlook message:

    newMail.Attachments.Add(noteItem, Outlook.OlAttachmentType.olEmbeddeditem)

    Please take a look at the How to: Attach an Outlook Contact Item to an Email Message article in MSDN for more information.

    Public Sub EmbedNote(ByVal note As NoteItem)
     Dim mailItem As mailItem
     Dim inspector As Outlook.inspector
     Dim attachments As Outlook.attachments
     Dim attachment As Outlook.attachment
     Set inspector = Application.ActiveInspector
     Set mailItem = inspector.CurrentItem
     Set attachments = mailItem.attachments
     Set attachment = attachments.Add(note, Outlook.OlAttachmentType.olEmbeddeditem)
    End Sub

    • Edited by Eugene Astafiev Thursday, January 16, 2014 7:50 PM
    • Marked as answer by Marvin_Guo Friday, February 7, 2014 12:32 PM
    Thursday, January 16, 2014 7:40 PM