I use C# and the Outlook 2010 object model to save Outlook emails to MHT format (MIME HTML). I have no problem saving an email as an MHT.
//mi is a MailItem
//Save As MHT
mi.SaveAs(#"D:\test.mht", OlSaveAsType.olMHTML);
There are aspects of the resulting MHT that I would like to customize.
An Outlook-generated MHT file does not display the Bcc line of emails known to have Bcc recipients. These emails are taken from a sender's email store. Are there options to force the display of the Bcc line?
If the source email is a rich text formatted email and contains embedded files, Outlook stores the embedded files in the resulting MHT. Outlook does this well. However, I would like to purge the embedded files. Are there options to force Outlook not to write embedded files to the MHT? Saving as plain HTML is not an option because I want to retain in-line images.
An Outlook-generated MHT file shows the display name of each recipient. I would like for the MHT file to show the display name and the email address of each recipient. Is there a way to do this?
There is no way to do that, you would need to generate the MHT file yourself.
Related
I do not have knowledge of VBA and I have researched stack overflow but can not get it working. Basically I want to save all attachments (csv files) that are moved by rule to my folder 'Test' in outlook and save in my Documents.
The rule move emails with attachments.
When I set up the rule I do not have the option to use a macro as a rule (company requirements).
Please help!
You could create a rule, refer to this link:
How To Automatically Download/Save Attachments From Outlook To A Certain Folder?
sSaveFolder = "C:\Users\DT168\Documents\outlook-attachments\"
This vba code is means where you want to save attachment. You could change this to your Documents folder URL.
I have an Outlook VBA macro that copies the contents of an email and saves them as a word document, using
activeMessage.GetInspector().WordEditor.Range.FormattedText.Copy
I'd like to change this to copy the contents of the email attachments instead. Is there a simple way to do this?
No, you will need to save the attachment as a file (Attachment.SaveAsFile), open it (depends on the file type), then access its data.
I need a macro script to:
Convert/Print email body to PDF file
Save that file to a folder
Delete the email after
I'm pretty clueless on using scripts/macros on outlook. Would need step by step process if possible. I do have adobe program for converting installed.
You can save the message as a DOC file (OlSaveAsType.olDoc), then use the Word Object Model to convert it to PDF.
I want to save all my emails into a PDF format. The file must contains which look similar to the Outlook Reading Pane into Outlook 2010.
Is there a programming way to to this (cause hundreds of emails) ?
I would use openpop to retrieve all your emails. Then you could loop through each email and save the body to a pdf.
I am trying to generate a report html file and email it as an attachment with vb.net
I know how send mail and attachments.
Do I need to generate the html file, save it as an .html file to the local disk where the program runs, then add its file path to the attachment property to send it to the recipient?
It is going to be a rather large report, and I would like to send it as an attachment instead of directly inside of the email itself.
Thanks
Yes, you save the file to disk ant then add to the Attactments collection of the MailMessage. Here is the C# syntax to create an Attachment from a file on disk and add the attachment to the message. It will be similar for VB.Net.
Attachment att = new Attachment(filename);
message.Attachments.Add(att);