Click here to Skip to main content
13,141,576 members (31,001 online)
Rate this:
Please Sign up or sign in to vote.
See more:
I am currently working on an application that can extract items from PST files and save it to a specified location. Right now I am using provided Microsoft.Office.Outlook.Interop to do this.

Here is some code that I use to save a contact Item. The code is similar for all the items that I am using.

Dim objitem As Object
If TypeOf objItem Is Outlook.ContactItem Then
            'Get out contacts
            ContactItem = CType(objItem, Outlook.ContactItem)
            strSaveName = (ContactItem.FullName.ToString) & ".vcf"
            ContactItem.SaveAs(strFolderPath & "\" & (strSaveName),   Outlook.OlSaveAsType.olVCard)
        End If

However when I try to save the item using the SaveAs() method, the security prompt will popup asking me to allow the application to use Outlook for a certain period of time. (1,5,10 min) if I am not wrong. I understand that Outlook redemption can bypass this. How should I do it?


Posted 21-Aug-12 15:34pm
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Why don't you ask the guys who made Redemption?? Here's the link[^].

After all, they would know the product better than anyone here.

If you have specific questions about a 3rd party library, you're best source of information on how to use that library is the manufacturer of it.
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

I have already tried asking but so far I've had no reply. My email might have gotten lost somewhere. Anyway I have found a dirty walkaround.

Basically I have to edit the registry key that controls the ObjectModelGuard. Using I set it to 0 like so*:

regvalue = My.Computer.Registry.GetValue("HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Office\14.0\Outlook\Security", "ObjectModelGuard", Nothing)
                If regvalue = Nothing Or regvalue = 0 Then
                    My.Computer.Registry.SetValue("HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Office\14.0\Outlook\Security", "ObjectModelGuard", 2)
                End If

Easy peasy. Outlook redemption is probably safer though but I think this tiny piece of code is worth not going through all the trouble of declaring everything as safeobjects.



*Note that this only works for 64 bit computers running Outlook 2010.

32 bit computers do not have the Wow6432Node so the registry key to alter will probably be


Also if you are not running Outlook 2010 but 2007 or earlier this key might be in 12.0 (2007) or even 11.0(I don't know what version this is)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web03 | 2.8.170915.1 | Last Updated 22 Aug 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100