babibarbara
New Member
- Joined
- Jun 19, 2015
- Messages
- 4
Hi, here is what I need: to create a rule that when a certain email arrives, I want to forward the message, but before I do I have to edit the body to delete the first 3 lines of the email, If I use the MailItem.Body it doesn't work because the email loses its formatting properties such as colors, images, etc, so I need to use the HTMLBody, my code works great, but everytime it gets to the MailItem.HTMLBody a question pops: "A program is trying to automatically send e-mail on your behalf. Do you want to allow this? If this is unexpected, it may be a virus and you should choose "No"."
How can I bypass this without using any add-ins, or third party programs? Only by vba code.
My code is in a module inside the outlook, I have a rule that call the macro "ChangeSubjectForward", and something as simple as this already triggers the message.
Sub ChangeSubjectForward(Item As Outlook.MailItem)
Dim htmlcode As String
htmlcode = Item.HTMLBody
End Sub
I'd be very happy if you guys can help me,
Thanks in advance.
Barbara
How can I bypass this without using any add-ins, or third party programs? Only by vba code.
My code is in a module inside the outlook, I have a rule that call the macro "ChangeSubjectForward", and something as simple as this already triggers the message.
Sub ChangeSubjectForward(Item As Outlook.MailItem)
Dim htmlcode As String
htmlcode = Item.HTMLBody
End Sub
I'd be very happy if you guys can help me,
Thanks in advance.
Barbara