Attaching files to an already open mail through VB.Net - email

I have a problem. I already have an outlook new mail message open. I need to programmatically attach files to the e-mail which is already open using vb.net. This is for a windows application. How could i do it? any ideas? please help!

The article here sounds specific to Outlook 2007 and VBA/Visual Basic, but is equally applicable to any Windows Application that wants to automate Outlook:
Automating Outlook from a Visual Basic Application [Outlook 2007 Developer Reference]:
http://msdn.microsoft.com/en-us/library/bb206737(office.12).aspx
Keep in mind the Caution disclaimer at the bottom over this "non-trusted" approach.
Once you're "in", you get get a handle to the active item via Application.ActiveInspector.CurrentItem. Then use MailItem.Attachments.Add.
You also need to keep this in mind:
Application Shutdown Changes in Outlook 2007 SP2:
http://msdn.microsoft.com/en-us/library/dd239276(office.12).aspx#ol2007AppLifecycle_ImpactforSolutions

Related

Is there a way to get a reference to results after creating word documents using mail merge?

I'm using a VSTO 2010 AddIn to do a Word mail merge with WdMailMergeDestination being set to wdSendToNewDocument. Is there any way to get a reference to the newly created documents or even find out which data row was used to create each one?
Hi Christopher i am working on the same thing and so far i have managed to create an add-in for the outlook. So the Word mail merge completes and the mail in the Outlook outbox folder, right before being sent will attach the attachment of any type.
I am using this for mass scale i am talking about 5000-7000 mails at one go, and the add-in failed me, by attaching to only some emails its like on and off (my guess is the add-in not able to handle the heavy duty). So now i am going a bit further in to the solution by capturing the mailmerge object in the word. (btw i am using i am developing for 2007 should be no problem for 2010 as well)
So far i can suggest you this article that i managed to dig if you have a found a solution please do share tks.
http://support.microsoft.com/default.aspx?scid=kb;en-us;301659
P.S: I know that there are people selling this kind of software commercially.But its best if homebrewed!

Is it possible to record the open emails in Outlook 2010 with PowerShell so that they can be opened again later?

This question is very similar to https://stackoverflow.com/questions/6839516/outlook-2010-reopen-messages which was closed as not being a question.
I have a bad habit of keeping emails open in Outlook 2010 as a reminder of what needs to be done during the day since I am constantly interrupted. What I would like to do is use PowerShell to get a list of the open emails so that if I need to close Outlook I know what I was working on before.
I am not worried about Outlook crashing, Outlook normally reopens all of the emails I had been working on automatically; the use case I am dealing with is when I have to manually close Outlook for a patch or to address some other issue.
What I would like to do is query the running Outlook process and see what messages are open; opening a new Outlook process via COM won't work since it would have a different list of open messages.
Does anyone know of a way to do this in PowerShell? I can use another language if needed, but have been attempting to standardize on PowerShell where possible so that other people here can reuse any code I write.
One possibility I have considered is to launch Outlook via PowerShell so that I have a way to interact with the running process.
First of all, you need to get a reference to the running Outlook instance.
$outlook = [System.Runtime.InteropServices.Marshal]::GetActiveObject('Outlook.Application')
Using the application object you then
Iterate through the outlook.Inspectors collection
Ask each individual Inspector for its CurrentItem
Store whatever properties you need from this item (date? subject? entry id?)

How to send a custom email with an attached report based on variables with MS Access? 2003 or 2007

I would need to send an email with standard text (but some custom parts like names and dates) with an attached pdf report generated with ms access. I prefer a solution for access 2003, but if it works on 2007 it's fine too.
Can be done directly from ms-access or I need some other apps/work?
thanks ;)
There are several articles that might come in handy to help you with this.
Creating PDF files from within Access
http://www.granite.ab.ca/access/pdffiles.htm
Report To PDF
http://www.lebans.com/reporttopdf.htm
Using Automation to Send a Microsoft Outlook Message
http://support.microsoft.com/?kbid=161088

Addressbook app and supporting existing formats

I need to implement an address book feature into an inventory app that I'm making, and I know that my client is always switching between different addressbook apps and email clients, and she always imports and exports info between them.
SO, I was thinking why not let her export contacts from within my app to an Outlook contact file or something.
But is this OK to do? Are we allowed to do it? And where abouts should I go for more information about this?
Thank you
Perhaps you can generate vCards if Outlook will import that format?
Edit: Also, if you are using Visual Studio (C# or VB.NET) try looking into the interop libraries. For example, in VS 2008, File > New Project, under Visual C# > Office, pick Outlook 2007 Add-in. See all questions on StackOverflow about office-interop.

Send To/Mail Recipient from WSH

I am trying to implement in windows scripting host the same function as windows Send To/Mail Recipient does. Did not find anything usefull on google except steps to instantiate Outlook.Application and directly calling its methods.
I need to go the same path as windows do, as there is a mix of Outlook and Lotus Notes installed, I don't see it good to perform some sort of testing and deciding which object to talk to...
What I have found is that the actual work is done by sendmail.dll, there is a handler defined in registry under HKEY_CLASSES_ROOT\CLSID\{9E56BE60-C50F-11CF-9A2C-00A0C90A90CE}. I would like either to use this dll somehow or to simulate the same steps it does.
Thanks for your input.
I found one item on CodeProject from 2003 that might be relevant.
The contents of the sent to menu in Windows is a bunch of files (usually links) in the C:\Documents and Settings\username\SendTo folder. You need to add your script - or a link to it - there.
For your script you could check if certain registry keys exist to detect Outlook and Lotus Notes.
Or if you don't care if the message shows up in sent items, just use CDOSYS.NewMail to send the message directly to the SMTP-server.
CDOSYS documentation