question

RubySharma-5813 avatar image
0 Votes"
RubySharma-5813 asked XingyuZhao-MSFT commented

Need to insert a picture in Outlook mail body using VB.net

![119035-outlook.png][1]Priority : High

Environment:
MS Outlook - Version 2019 (32 Bit)
OS: MS Windows 10 Pro
Development Language: - VB.net

Requirement : I need to insert a picture in the Outlook body using mail object in Vb.net code that we do manually.
It should be shown at center of the mail body.

office-outlook-itprodotnet-visual-basic
outlook.png (41.9 KiB)
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @RubySharma-5813 ,

Please kindly understand under Outlook tag, we mainly focus on general issues about Outlook desktop client. Considering that your issue may be more related to vb.net development, I would add dotnet-visual-basic tag under your post to solve it better. Thanks for your understanding and hope your issue would be resolved soon.

0 Votes 0 ·

1 Answer

Castorix31 avatar image
0 Votes"
Castorix31 answered XingyuZhao-MSFT commented

This test works for me (you can change/improve the HTML code...) =>

119501-outlook-image.jpg

Link to the code that I cannot post....



outlook-image.jpg (35.2 KiB)
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @Castorix31

This code will embed a picture in html body with some html content so now if I want to add my message content or want to insert an image in the mail body manually I won't be able to do so.
HTML body is already been used by html content.

So this is the exact problem I am facing

I was trying some code this way
'loadingImage = fileLocation & "\Images\loading.gif"
'mail = CType(actInspector.CurrentItem, Outlook.MailItem)
'mail.HTMLBody = "<body><center><img src =" & loadingImage & "></center></body>" & mail.Body
''mail.Display()

But this will remove the image that you will insert manually from the (Insert ->Pictures)tab
So if you can help ,me out in this

It would be really greatful

0 Votes 0 ·

Hi @RubySharma-5813 ,

... insert an image in the mail body manually

If you need to insert pictures manually, why not use outlook app?

0 Votes 0 ·