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>ATTACHMENTS"
For K As Integer = 1 To Item.Attachments.Count
AttachmentString &= "<br>\" + Item.Attachments(K).DisplayName & \""
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 |
|
Sergey Grischenko
Add-in Express team
Posts: 7235
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/
|
|