![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
Hi newsgroup,
I want to pass E-Mail-addresses from a Windows form to an ActiveInspectors CurrentItem. I'm a little bit confused of the handling of OlMailRecipientType: If I create a new mail item for test purposes in Example 1, everything is going well. But if I refer to the CurrentItem of an ActiveInspector (see Example 2) I have to fill the olTo-Field AFTER the olCC and olBCC fields are filled. Otherwise the e-mail-addresses are not filled in the correct fields of the CurrentItem "mail draft" - which is working perfect in Example 1. As you can see I found a way to handle this behaviour by filling olTo at last, but I have no idea why this is necessary! Any ideas are appreciated. Kind regards, Steffen Example 1 Dim objOutlook As New Outlook.Application Dim olNameSpace As Outlook.NameSpace Dim objOutlookMsg As Outlook.MailItem Dim objOutlookRecip As Outlook.Recipient olNameSpace = objOutlook.GetNamespace("MAPI") objOutlookMsg = objOutlook.CreateItem(Outlook.OlItemType.olMailIte m) With objOutlookMsg objOutlookRecip = .Recipients.Add(EmailTo) objOutlookRecip.Type = Outlook.OlMailRecipientType.olTo objOutlookRecip = .Recipients.Add(strCC) objOutlookRecip.Type = Outlook.OlMailRecipientType.olCC objOutlookRecip = .Recipients.Add(strBCC) objOutlookRecip.Type = Outlook.OlMailRecipientType.olBCC .Display() End With Example 2 Dim objOutlook As Outlook.Application Dim objOutlookMsg As Outlook.MailItem Dim objOutlookRecip As Outlook.Recipient objOutlook = Globals.ThisAddIn.Application objOutlookMsg = objOutlook.ActiveInspector.CurrentItem With objOutlookMsg objOutlookRecip = .Recipients.Add(strCC) objOutlookRecip.Type = Outlook.OlMailRecipientType.olCC objOutlookRecip = .Recipients.Add(strBCC) objOutlookRecip.Type = Outlook.OlMailRecipientType.olBCC objOutlookRecip = .Recipients.Add(EmailTo) objOutlookRecip.Type = Outlook.OlMailRecipientType.olTo End With |
Ads |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Question | Inese Vauhkonen | Outlook Express | 1 | March 13th 07 11:49 AM |
DST Question | Tony | Outlook - General Queries | 2 | March 12th 07 04:05 PM |
OE question | supertech | Outlook - General Queries | 1 | December 11th 06 07:03 AM |
OE & AOL question | Doug Kanter | Outlook Express | 2 | April 24th 06 08:39 PM |
question | manish goyal | Outlook and VBA | 1 | January 21st 06 09:09 AM |