Mail Userform into outlook mail body

Yakuz

New Member
Joined
Aug 22, 2008
Messages
4
hey all,

is there a way to export the userform as a picture, like for charts?

sh.ChartObjects("Chart 1").Chart.Export _
Filename:=Fname1, FilterName:="GIF"

thanks in advance !
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
hey all,

is there a way to export the userform as a picture, like for charts?

sh.ChartObjects("Chart 1").Chart.Export _
Filename:=Fname1, FilterName:="GIF"

thanks in advance !

I would like to use a simmular code as this:

Code:
TempFilePath = Application.DefaultFilePath & "\"
    Set sh = Worksheets("Charts")
    Fname1 = Application.DefaultFilePath & "\Chart1.gif"
    sh.ChartObjects("Chart 1").Chart.Export _
            Filename:=Fname1, FilterName:="GIF"

   On Error Resume Next
    AppActivate "Outlook"
    On Error GoTo 0
    Set OutApp = CreateObject("Outlook.Application")
    OutApp.Session.Logon
    Set OutMail = OutApp.CreateItem(0)
    On Error Resume Next
    'msg = ""
    With OutMail
     .To = ""
    .CC = ""
    .BCC = ""
    .Subject = ""
    .HTMLBody = .HTMLBody & ""
    .Attachments.Add Fname1
   .Display
  
End WithOn Error GoTo 0
Kill Fname1
 
Upvote 0
See the code linked here http://www.mrexcel.com/forum/excel-questions/331211-save-userform-bmp.html#post1630026 for saving a userform as a bitmap image.

To include the image in the email body, there are two ways I can think of:

1. First insert/import the image into a worksheet cell then use the MailEnvelope object to include the the top left and bottom right cells range surrounding the image. See Mail selection, range or worksheet in the body of a mail with MailEnvelope (Outlook only).

2. Use HTML < img > tag with the src='cid:image.bmp' attribute and include the image as a file attachment.
 
Upvote 0

Forum statistics

Threads
1,223,742
Messages
6,174,240
Members
452,553
Latest member
red83

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top