When I use the following code and rem out the 'mi.To += ";test;test2" it
deletes the entries that are already in the To: field. I have tried using
toVal = miTo().toString followed by mi.To += toVal but then the
mailInspector can't find the currentItem.
Any suggestions or links where I can research will be appreciated.
Thank you,
""Peter Huang" [MSFT]" <v-phuang@online.microsoft.com> wrote in message
news:5bZ152hRFHA.11204@TK2MSFTNGXA01.phx.gbl...[color=blue]
> Hi
>
> We can use the Outlook automation to get the opened outlook application
> and
> get the current opend mail message editor instance.
> e.g.
> Dim olApp As Outlook.Application
> Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles Button1.Click
> olApp = GetObject(, "Outlook.Application") 'We assume the outlook
> application is started, because we are modifying an composing mail
> message.
> Dim mailInspector As Outlook.Inspector = olApp.ActiveInspector 'Get
> the mail message editor instance
> Dim mi As Outlook.MailItem
> mi = mailInspector.CurrentItem 'Get the mailitem
> mi.To += ";test;test2"
> mi.CC += ";testg;dfd"
> mi.BCC += ";testd;fdf"
> mi.Recipients.ResolveAll()
> End Sub
>
>
> Here is a link.
> Note Because of the Outlook E-Mail Security Update, when you run the
> following procedures, you will be prompted several times for permission to
> access your e-mail addresses and one prompt to send your message (see the
> following screen shots). This is expected behavior. For more information,
> see Security Features for Outlook 2002 and Previous Versions.
>
http://msdn.microsoft.com/library/de...us/dno2k3ta/ht
> ml/odc_ac_olauto.asp
>
> Best regards,
>
> Peter Huang
> Microsoft Online Partner Support
>
> Get Secure! -
www.microsoft.com/security
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
>[/color]