Outlook 2002 Object Model Guard

Add-in Express™ Support Service
That's what is more important than anything else

Outlook 2002 Object Model Guard
 
John Renzi




Posts: 1
Joined: 2006-10-02
I'm having a problem with Outlook 2002 security popups. I've been reading a lot about the problem but have not found an acceptable answer.

Is it possibly to iterate through selected messages and modify their HTMLBody property without running into outlook security?

I'm using the following code. It is contained in a command bar button click event.

Dim AttachmentString As String

For I As Integer = 1 To OutlookApp.ActiveExplorer.Selection.Count
Dim Item As Outlook.MailItem = CType(OutlookApp.ActiveExplorer.Selection(I), Outlook.MailItem)

If Item.Attachments.Count > 0 Then

If Item.BodyFormat = Outlook.OlBodyFormat.olFormatHTML Then
AttachmentString = "<br><br>3"

For K As Integer = 1 To Item.Attachments.Count
AttachmentString &= "<br>2"
Next
Item.HTMLBody &= AttachmentString
Item.PrintOut()
Item.HTMLBody = Replace(Item.HTMLBody, AttachmentString, "")
Else
' Has attachments but not in html body mode
Item.PrintOut()
End If

Else
' No attachments
Item.PrintOut()

End If

Next
Posted 02 Oct, 2006 19:25:11 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi John.

Sorry for delay.
I am afraid it is not possible via the Outlook Object Model.
But we have a solution. To prevent this issue you can use our 'Outlook Security Manager' product.
Please look at this: http://www.add-in-express.com/outlook-security/
Posted 26 Oct, 2006 11:47:21 Top