I get the prompt when my code attempts to read the message body. (I'm
reading it in HTML in the example below, but a text read gets the same
error.) It's line two below:
Sub PrintBodyRule(Item As Outlook.MailItem)
Dim messageBody As String
messageBody = Item.HTMLBody
.
.
End Sub
So the question is "should a vb be able to read Item.HTMLBody without
getting this security warning, when the vb code runs as a RULE script?"
The project is signed. I have tried various (macro) security settings. My
outlook version is 2003, SP1.
The full rule's reason to live is to print ONLY the body of a message. A
macro works just fine when I open up a mail message and run it from the tools
menu. In that case I use Outlook.ActiveInspector.CurrentItem.HTMLBody to
access the body.
If anyone wants a copy of the code, shoot me an email and I will send it off
or post it.
Thanks...Chuck
--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx
"chuck rudolph" <chuckr...@discussions.microsoft.com> wrote in message news:C3FD6018-5A7B-46DC...@microsoft.com...
if the MailItem has its EntryID already then you could use the
following:
Sub PrintBodyRule(Item As Outlook.MailItem)
Dim oMail as Outlook.MailItem
Dim messageBody As String
Set oMail=Application.Session.GetItemFromID(Item.EntryID)
messageBody = oMail.HTMLBody
--
Viele Grüße
Michael Bauer - MVP Outlook
"chuck rudolph" <chuckr...@discussions.microsoft.com> wrote in
message news:C3FD6018-5A7B-46DC...@microsoft.com...
--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx
"Michael Bauer" <mi...@t-online.de> wrote in message news:%23ky6srX...@TK2MSFTNGP09.phx.gbl...
Now, can either of you explain why the "simple" [Item.HTMLBody] approach
causes the dialogbox to appear, whereas the "complex" [Michael's two lines
below] approach does not?
Thanks...Chuck
"Michael Bauer" wrote:
> Dim oMail as Outlook.MailItem
> Set oMail=Application.Session.GetItemFromID(Item.EntryID)
>
> Dim messageBody As String
> messageBody = oMail.HTMLBody
>
obviously the MS developers have decided that the MailItem argument
shouldn´t be trusted. On the other hand all Items accessed via the
intrinsic Application object *are* trusted (since OL 2003).
I.e. you need the reference returned from the intrinsic Application
object and the event´s argument isn´t from.
--
Viele Grüße
Michael Bauer - MVP Outlook
"chuck rudolph" <chuckr...@discussions.microsoft.com> wrote in
message news:D031EFEC-B2F0-4F44...@microsoft.com...
--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx
"Michael Bauer" <mi...@t-online.de> wrote in message news:uRKP8gyQ...@tk2msftngp13.phx.gbl...