Hi,
We have a dialog that hosts browser control to display HTML email messages. The dialog also has reply/forward buttons and the dialog is shown from an Outlook add-in.
When the user clicks on reply/forward, we retrieve reply-action from mailItem.Actions, execute the action, and use the returning mailItem to display the reply-inspector.
It all works fine. Except that when HTML message has external images i.e. images which are hosted elsewhere on the web, and are referenced in html.
I know there is a setting in Outlook to allow Automatic Download of pictures. And if I turn that settings OFF, all works fine.
But with that setting ON, when I hit reply button, I get "Automatic Pictures Download" dialog, telling me that email-message contains external content and asking me if I want to download external content. When I press 'Yes', it doesnt download
the images, and images appear as white-boxes.
However if I hit reply from within Outlook, and press 'Yes' on the same dialog, it does download the images and shows them fine.
Why it doesnt download the pictures when Reply-action is executed from code?
To prove the point that there is nothing wrong with our workflow, I have tried to do the same thing using VBA(Outlook), and it is showing the same behaviour i.e. not showing the pictures when I press Yes.
VBA code:
Sub TestReply()
Dim oApp As New Outlook.Application
Dim oExp As Outlook.Explorer
Dim oSel As Outlook.Selection ' You need a selection object for getting the selection.
Dim oItem As Object ' You don't know the type yet.
Dim mailItem As Outlook.mailItem
Dim replyItem As Outlook.mailItem
Dim act As Outlook.Action
Set oExp = oApp.ActiveExplorer ' Get the ActiveExplorer.
Set oSel = oExp.Selection ' Get the selection.
For i = 1 To oSel.Count ' Loop through all the currently .selected items
Set oItem = oSel.Item(i) ' Get a selected item.
Set mailItem = oItem ' Assign it to a MailItem object
Set act = mailItem.Actions(1) ' 1 is reply-action
Set replyItem = act.Execute() ' Exec the action and get reponse mail-item object
'Set replyItem = mailItem.Reply()
replyItem.Display False ' Display the reply inspector
Next i
End Sub
Also, on a similar note, if I click the banner showing in Outlook message-preview to download external pictures, and then hit 'Reply' on Outlook toolbar, it doesnt ask to download external images, as it has already downloaded them.
When I display the same email-message in my dialog-browser-control, I display the external images, regardless of Outlook settings. But when I hit Reply on my dialog, I get this dialog. Is there a way to tell Outlook that I have downloaded the images already
and this is the location, so that images are displayed normally?
I appreciate your time and help.
Regards,
Muhammad.