Questions tagged [mailitem]

MailItem is an object that represents a mail message in Visual Basic for Applications (VBA). Questions about its properties, methods, corresponding events and usage in general may have this tag.

181 questions
3
votes
1 answer

Shared Inbox - Skipping non-mail items in Outlook VBA

I am not an expert in Outlook VBA but I have managed to create a few macros that work quite well. I have worked on the below code for some time and am now left with a minor problem. The macro imports information on every email from a sub-folder of a…
Colin Torpey
  • 63
  • 1
  • 1
  • 7
3
votes
0 answers

Reading properties from a Mailitem in Outlook outbox makes it not send

I'm writing a VSTO app for Outlook 2007 that periodically checks mails in the Outbox. I can run over the MailItems and check the .Submitted property with no adverse effects. But if I read the SentOn property than the mail in Outlook stops being…
MrPurpleStreak
  • 1,477
  • 3
  • 17
  • 28
3
votes
1 answer

Capturing changes to MailItem.SendUsingAccount property in Outlook

I am working on an Outlook extension that requires making a change to a MailItem open in a compose window if the SendUsingAccount property is changed via the GUI. I would like to be albe to apply my changes automatically, but I cannot find any…
B Sharp
  • 477
  • 8
  • 16
3
votes
1 answer

Can't seem to add a line feed to the end of HTMLBody (
tag getting trimmed)

We're creating an Outlook mailitem and setting up a part of the message body. However the client wants the message body to end with a clean fresh line so he can add further text. It's a trivial request but ... It seems adding anything which isn't a…
hawbsl
  • 15,313
  • 25
  • 73
  • 114
3
votes
1 answer

Standalone Outlook app - way to databind to folder mail?

I am developing a standalone Outlook WPF application in C#. What I am trying to do is have the program monitor a public folder for any incoming mail and notify the users of any mail arrival. I've successfully done this but I feel the manner in…
Jake Shakesworth
  • 3,335
  • 4
  • 29
  • 43
3
votes
1 answer

How to check all rules which can be applied to a mailItem in Outlook

I am writing an application which has to get items that can be matched with rules. //new messages goes here void items_ItemAdd(object Item) { //all rules Rules rules = Application.Session.DefaultStore.GetRules(); …
Alexandr
  • 5,460
  • 4
  • 40
  • 70
2
votes
1 answer

Unable to read Outlook Mail Items using win32com when run as exe build using pyInstaller - Python code works

I have following code which is able to read Mail Items from outlook and download the attachment when python code is run using eclipse. however, when the same code is compiled to an exe using pyinstaller, it fails to read the mail items with error:…
Kiran Jain
  • 171
  • 1
  • 14
2
votes
3 answers

Get named MAPI Property from MailItem in C#

I'm developing an Outlook 2010 custom plugin in C#. This is my first time using C# (I'm a java guy normally). There is a named (custom) MAPI property on a message that I would like to access and am having trouble doing so. My understanding is that…
2
votes
2 answers

Create/Open existing msg from path to new Outlook.MailItem in c#

Hello I'd like to create a Outlook.MailItem ( I believe ) from an existing one located on disk. I have the path stored in a string, and would like to access to save the body and attachments from it. I can't seem to figure out how to open it in c#…
extraordin
  • 83
  • 1
  • 6
2
votes
3 answers

Outlook.MailItem.PropertyChange stops firing after 9 events

I'm working on an Outlook Add-In that manages a project list based on emails that my production manager sends me. I have the project working well in VBA within outlook, but I'm tired of seeing the security message that pops up when using VBA. So,…
2
votes
0 answers

Outlook mailitem.sender generates error 287 in Excel

I am trying to pull details of Outlook mail items in a shared mailbox. To make it easier for colleagues I created the macro in Excel. It is falling down at: sender = olItem.sender In Outlook VBA it pulls through the name of the sender of the…
2
votes
2 answers

Why encoding headers content type: text/html; is missing when use MailItem in Outlook plugin, whith the SMTP server of GMAIL: SMTP.GMAIL.COM?

I try to send HTML to gmail account, from to gmail SMTP server. If i write code like that and send HTML there is no problem. MailMessage mail = new MailMessage("aaaa@gmail.com", to, subject, body); mail.IsBodyHtml = true; …
Cédric Boivin
  • 10,854
  • 13
  • 57
  • 98
2
votes
2 answers

Modify HTMLBody for Inline Response in outlook

I am trying to modify the body of an inline reply in Outlook. I need to insert HTML into the inline response editor. I am trying to do it like this: var explorer = application.ActiveExplorer(); MailItem item…
Matt Kagan
  • 611
  • 1
  • 12
  • 24
2
votes
1 answer

Creating Outlook Mail Drafts from Excel in Office 365

I have an existing VBA code snippet in Excel we used to create Outlook mail drafts in Office 2013. Consider the following code which worked fine and allowed the mails to be manually sent within Outlook after creation: Dim objOLOutlook As New…
Gess
  • 459
  • 6
  • 15
2
votes
1 answer

MailItem.HtmlBody throws a Not Implemented exception

I have a ribbon button that inserts text into an outlook Inspector by modifying the MailItem object based on the recipients in it. The method that gets called on click looks like this: public async void OnTemplateClick(Office.IRibbonControl…
Matt Kagan
  • 611
  • 1
  • 12
  • 24
1
2
3
12 13