Outlook - new mail text

Add-in Express™ Support Service
That's what is more important than anything else

Outlook - new mail text
 
Alfred Dworschak




Posts: 13
Joined: 2007-03-06
dear AIE-Team,

today I got my installation code for Add-In-Express premium. At first glance I am very impressed! Really!

I would like to develop an Outlook Add-In, which shows a button on the new mail window. On pressing this button, I should be able to access the Mail-Text, Mail.Subject and to add an additional Attachment.

Are there any sample codes, which show some of these functions?

regards from Austria

Alfred
Posted 06 Mar, 2007 10:41:54 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Alfred.

What version of Visual Studio .NET do you use?


P.S. Note that we take up your forum requests in the order we receive them.
Besides, it may take us some time to investigate your issue. Please be sure we will let you know as soon as the best possible solution is found.
Posted 07 Mar, 2007 07:24:28 Top
Alfred Dworschak




Posts: 13
Joined: 2007-03-06
hi sergey,

I develop in

Visiual Studio 2005!

C# .NET 2.0

these functions should work at runtime! after sending I have already archieved it!

Is there a way to print send the current mail to the printer?

alfred
Posted 07 Mar, 2007 07:38:08 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Alfred, there is the Print button in the Outlook main menu.
Doesn't it fit for you?
Posted 07 Mar, 2007 08:32:35 Top
Alfred Dworschak




Posts: 13
Joined: 2007-03-06
Sergey,

no, printing should be automaticly without any user interaction. Mailtext should be printed to PDF printer, file catched and attached to current mail. Subject and Mailtext should be altered to show, that the former mailbody was attached as a PDF.

for this i would need to print the mailbody and access the mail during runtime! (attachment, mailtext, subject)

Alfred
Posted 07 Mar, 2007 08:38:00 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Alfred, I am afraid it is not possible to print mails via the Outlook Object Model.
Posted 07 Mar, 2007 09:02:31 Top
Alfred Dworschak




Posts: 13
Joined: 2007-03-06
thank you for your answer!

no problem! I can do that after sending!

but is it possible to print the mailtext? can be even afterwards

if I use

PrintTime = DateTime.Now;
Outlook.ApplicationClass outlookApp = new Outlook.ApplicationClass();
Outlook.MailItem mailItem = outlookApp as Outlook.MailItem;

System.Drawing.Printing.PrintDocument pd = new System.Drawing.Printing.PrintDocument();

// Es wird ?berpr?ft ob Einstellungen vorhanden sind
if (pd.PrinterSettings == null) pd.PrinterSettings = new System.Drawing.Printing.PrinterSettings();

// Druckername wird gesetzt
pd.PrinterSettings.PrinterName = "xyzmo Seal";

// register for the end print notification
pd.EndPrint += new PrintEventHandler(document_EndPrint);

// Ausdruck wird gestartet
pd.Print();

then just an empty page will be printed!

alfred
Posted 07 Mar, 2007 09:11:57 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Posted 07 Mar, 2007 11:22:40 Top