Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Interop / February 2004

Tip: Looking for answers? Try searching our database.

Extended Mapi

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
John Galt - 05 Feb 2004 04:08 GMT
Has anyone used extended MAPI to automate Outlook?
I had code that worked thru CDO but wanted to avoid the Outlook security
Patch that kept popping up a dialog box.

When I changed my code using the redemption library IU ran into problems
traversing the Folder structure.

Before the change the code below worked fine.  The Id of the folder I want
is in Getfolder...
When I made the Redemption chnage that statement Gives me a Run-time
error -2147024809(80070057) [Collaboration Data
Objects -[E_INVALIDARG(80070057)]].

The code I have is:

Private Function LoadContacts()

Dim varInvCnt As Long
Dim InvSelect As Long
Dim InvSelected As String

Dim objSession As MAPI.Session
Dim objFolder As Redemption.MAPIFolder
Dim objmessages As MAPI.Messages
Dim Objfields As MAPI.Fields
Dim objmessage As MAPI.Message

    Set objSession = CreateObject("MAPI.Session")
    If Not objSession Is Nothing Then
      strProfileName = "MS Exchange Settings"
      objSession.Logon strProfileName, "", False
   End If

    '*** GetFolder("My Local E-Mail\Morang Cove Trading Company\MCTC
Contacts")
   Set objFolder =
objSession.GetFolder("{00000000515BA5871FC8D5119923000475762650C2960000}")
Ken Slovak - [MVP - Outlook] - 05 Feb 2004 16:13 GMT
Redemption.MAPIFolder doesn't work like that. It's like SafeMailItem.
You have to get the folder object first and then assign the folder
object to MAPIFolder.Item. So your code should get a MAPI.Folder
object and assign that to objFolder.Item before you try to work with
objFolder.

Dmitry (the guy that wrote Redemption and OutlookSpy) uses Extended
MAPI all the time BTW and both of those applications were written
using Extended MAPI. You do know that the only languages that Extended
MAPI supports are C++ and Delphi? No variations of VB or C# or VB.NET
can be used with it.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginners Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm

> Has anyone used extended MAPI to automate Outlook?
> I had code that worked thru CDO but wanted to avoid the Outlook security
[quoted text clipped - 32 lines]
> Contacts")
>     Set objFolder =

objSession.GetFolder("{00000000515BA5871FC8D5119923000475762650C296000
0}")
John Galt - 06 Feb 2004 15:36 GMT
Is there anyway to suppress the security patch dialogs?

> Redemption.MAPIFolder doesn't work like that. It's like SafeMailItem.
> You have to get the folder object first and then assign the folder
[quoted text clipped - 59 lines]
> objSession.GetFolder("{00000000515BA5871FC8D5119923000475762650C296000
> 0}")
Ken Slovak - [MVP - Outlook] - 06 Feb 2004 20:46 GMT
By using Redemption, Extended MAPI, a trusted COM addin or the
settings in the security form if you are using Exchange. I use
Redemption so my apps are compatible whether or not Exchange is used.

In Outlook 2003 all VBA Outlook object model code and COM addin code
that derives all Outlook objects from the Application object passed in
the On_Connection event is trusted, but CDO code is never trusted.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginners Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm

> Is there anyway to suppress the security patch dialogs?
Ian D. - 09 Feb 2004 04:51 GMT
I use CDO but need to get around that security pop-up as well.  Can I
take your last sentence to mean you cannot use CDO in a COM addin?

> By using Redemption, Extended MAPI, a trusted COM addin or the
> settings in the security form if you are using Exchange. I use
[quoted text clipped - 13 lines]
>
> > Is there anyway to suppress the security patch dialogs?
Ken Slovak - [MVP - Outlook] - 09 Feb 2004 14:54 GMT
You can use CDO 1.21, I do all the time. It's just not trusted. So any
property or method that is restricted will fire the security prompts.
There's no way to get a CDO Session trusted. When I need to use
restricted properties or methods I use Redemption code, but the other
options you could use are what I mentioned.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginners Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm

> I use CDO but need to get around that security pop-up as well.  Can I
> take your last sentence to mean you cannot use CDO in a COM addin?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.