--Source Code Begiin---
Imports Microsoft.VisualBasic
Imports System.IO
Imports System.Text
Imports Microsoft.Win32
Imports System
Imports System.Management
Imports System.Collections.ObjectModel
Imports MAPI
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim objSession As MAPI.Session
Dim MailBox As MAPI.Messages
Dim InMessage, fwdMessage As MAPI.Message
Dim recp
objSession = CreateObject("MAPI.Session")
objSession.Logon(ProfileName:="admin",
ProfilePassword:="al1234_BB")
MailBox = objSession.Inbox.Messages
InMessage = MailBox.GetFirst
fwdMessage = InMessage.Forward //Getting Exception here..
Recp = fwdMessage.Recipients.Add
Recp.Name = "us...@exchange.pro.com"
Recp.Resolve()
fwdMessage.Send()
objSession.Logoff()
objSession = Nothing
End Sub
End Class
--Source Code End---
Exception : MAPI_E_UNKNOWN_ENTRYID(80040201)
How to overcome this problem?
Thanks
Why use CDO for your code anyway, there's nothing special in there that
can't be done by using the Outlook object model, which is supported for
managed code.
--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm
"Bakshi" <RSBa...@gmail.com> wrote in message
news:3f8cd1d1-9f0f-4d3e...@c4g2000hsg.googlegroups.com...
"Ken Slovak - [MVP - Outlook]" <kens...@mvps.org> wrote in message
news:O6U1S$cXIHA...@TK2MSFTNGP03.phx.gbl...
To get out of office state in Outlook 2007 you'd use the default Store
object and the PropertyAccessor to look at PR_OOF_STATE (0x661D000B or
http://schemas.microsoft.com/mapi/proptag/0x661D000B in DASL).
In earlier versions of Outlook you'd have to use CDO or Redemption or
Extended MAPI, but again CDO and Extended MAPI aren't supported in managed
code.
Out of office text is stored in a hidden message in the Inbox with a
MessageClass of "IPM.Note.Rules.OofTemplate.Microsoft". The text is in the
body property of that hidden message.
--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm
"Norman Yuan" <Fake...@FakeEmail.Not> wrote in message
news:OGV%237C5XI...@TK2MSFTNGP06.phx.gbl...
"Ken Slovak - [MVP - Outlook]" <kens...@mvps.org> wrote in message
news:uKiw7W5X...@TK2MSFTNGP05.phx.gbl...