Open Outlook OFT template and populate recipient address - vb.net

Working in a Windows Forms application and VB.NET.
I need to pop open an Office "New Message" window, populate the "To" address, and place an OFT template in the body of the message. I do not need to modify anything in the template.
To open the new message with the template, i could:
Diagnostics.Process.Start("MyFile.oft")
But this will not help with setting the TO address, or subject.
I also don't want to download any third party add-ons.
Any help??

You can use the Outlook Object Model and call Application.CreateItemFromTemplate. You can then set Subject/To/CC/BCC properties and the Recipients collection on the returned MailItem object.

Related

How to associate code with a checkbox in an Outlook template?

I have created an Outlook template with checkboxes included. I want to display a message when a checkbox has been ticked. I have written some basic codes (msgbox etc.) related to each checkbox.
Issue:
How can I include/integrate my codes in the Outlook template?
Looks like you need to create a new custom Outlook form with a code behind. You can read more about that in the Create an Outlook Form article.
You will not be able to achieve the required functionality with a message body. Any scripts from message bodies can't be run for security matters.

Automatically insert email signature into Outlook Meeting Invite

I have been searching the web for a way to do this but no such luck. My goal is to save a meeting agenda template into an email signature which would be inserted into every meeting invite created by me.
Looking for some clues on how to do this?
Outlook 2010 and newer include the form designer.
File -> Options -> Customize Ribbon, then, in the Right Side pane, click to turn on the Developer Tab.
From there you can design Meeting Request template to your specification.
Then, to use it, you will select:
New -> Meeting Request Using -> (Your Custom Template) from the Outlook Home tab.
You can handle the ItemSend event of the Application class where you can check out the message class of the outcoming Outlook item and change the message body if required.
Think you will find the Getting Started with VBA in Outlook 2010 article helpful.

How to open default (X) mail client along with to, cc, bcc, html body & attachment of active workbook using VBA in excel

We have a requirement like we need to open default mail (what ever may be like : MS Outlook, Mozilla Thunderbird,Windows Live Mail, Opera Mail etc. ) along with to, cc, bcc, html body & attachment of active workbook on a button click in Excel using VBA.
Thanks in advance. if any one can help me.
You can use the Shell method passing the mailto string. See How to use command line switches to create a pre-addressed e-mail message in Outlook for more information.
Also you may consider automating Outlook. See How to automate Outlook from another program for a sample code.

How to change salutation for multiple recipients in Outlook with c#

I want to code an outlook addin and try to replace a placeholder in an outlook mail with the salutation of the recipient. I get the salutation from AD. I tried this in ItemSend, but the body for different recipients contains always the last replacement.
Then i generated a new mail per recipient. That seems to be the right way, but there is the next problem. The mailitem.htmlbody contains not the same content like shown in the outlook message window. All styles of the original message are lost and for instance my signature is bad formatted.
Has anyone an idea to solve my problem?
First of all, if want to send an individual "salutation" for each recipient you need to send separate emails. For example, you can check out the list of recipients in the ItemSend event and if it contacts more than one entry in the collection you can cancel the send operation setting the Cancel parameter to true and prepare an individual email to each recipient from the collection.
You may consider using the Word object model instead of modifying the raw HTML markup of the body. The WordEditor of the Inspector class returns an instance of the Document class from the Word object model. The Chapter 17: Working with Item Bodies describes all possible ways of working with item bodies.

SharePoint 2010 Email Outlook File to Library with attachments embedded

The only way I have found to retain attachments with an email from Outlook to SharePoint is to do a save as .msg and drag and drop into the SharePoint library.
I would like to set the library to receive email and retain the attachment as part of the email. I don't want the attachments to separate from the email when they arrive in the library.
Is there an add-in to Outlook or a fix in SharePoint 2010??????
You have two options:
1. Stick with the SharePoint options like adding attachments to the library or to a sub folder of the library based on subject or sender.
2. Write a custom email event handler. Here is an example for 2007, but it should work in 2010 as well: http://blogs.msdn.com/b/malag/archive/2009/05/13/attachments-disappear-with-custom-email-event-handler.aspx
marco
Marco, when I created the EventHandler to try and retain the message and attachment when activated it still came through as it was before by separating the message and attachment in two different files
Yes there are add-ins. I have used some 3rd Party tools for Outlook and SharePoint:
Scinaptic's OnePlaceMail
Colligo
Macroview
They are all good.