none
sending a mailitem to onenote in VBA

    Question

  • when I right mouse on an outlook mailitem it has an action called "OneNote" that allows the emails to be sent nicely formatted to OneNote. I am trying to mimic that functionality in VBA code. goal is to read all the mail items in an Outlook folder and send them to Onenote.

    mailitem.actions does not have most of the options shown when I right mouse on a mail item in outlook.

    has anyone done this?

    thanks


    Larry Ringstad

    Monday, February 25, 2013 8:57 PM

Answers

  • you could always try to invoke ribbon command for this action and let outlook do all heavy work (using CommandBars.ExecuteMso function)
    Tuesday, February 26, 2013 1:00 PM
  • Do you want to send to OneNote or what? What end result would you want?

    If you execute a ribbon button using CommandBars.Execute() syntax the end result would be the default action of the button. You cannot override the default action unless you use a COM addin and handle the ribbon onAction callback for the button or repurpose the button.

    You might be able to use Word formatting functions as a subset of the full Word is used as the Outlook email editor. If the item is open as ActiveInspector, the Word.Document object for the email body is ActiveInspector.WordEditor.

    You can get that Document object and do whatever formatting the Word email subset of functions allow.


    Ken Slovak MVP - Outlook

    Tuesday, February 26, 2013 9:26 PM
    Moderator

All replies

  • Hi Larry,

    Thank you for posting in the MSDN Forum. 

    You've mentioned

    I am trying to mimic that functionality in VBA code.

    in your thread.

    It based on my experience that the request is impossible to realize.

    Hope it helps.

    Best regards,


    Quist Zhang [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, February 26, 2013 11:19 AM
    Moderator
  • you could always try to invoke ribbon command for this action and let outlook do all heavy work (using CommandBars.ExecuteMso function)
    Tuesday, February 26, 2013 1:00 PM
  • thats depressing. But I am beginning to see where that is true since I have spent a couple of days wrestling with this

    Larry Ringstad

    Tuesday, February 26, 2013 6:40 PM
  • Do you want to send to OneNote or what? What end result would you want?

    If you execute a ribbon button using CommandBars.Execute() syntax the end result would be the default action of the button. You cannot override the default action unless you use a COM addin and handle the ribbon onAction callback for the button or repurpose the button.

    You might be able to use Word formatting functions as a subset of the full Word is used as the Outlook email editor. If the item is open as ActiveInspector, the Word.Document object for the email body is ActiveInspector.WordEditor.

    You can get that Document object and do whatever formatting the Word email subset of functions allow.


    Ken Slovak MVP - Outlook

    Tuesday, February 26, 2013 9:26 PM
    Moderator