mikeellinas
New Member
- Joined
- Nov 7, 2017
- Messages
- 25
I use the following code to copy a range of cells and paste it as an image into a new email:
Sub Email()
'Copy range of interest
Dim r As Range
Set r = Range("A1:E24")
r.Copy
'Open a new mail item
Dim outlookApp As Outlook.Application
Set outlookApp = CreateObject("Outlook.Application")
Dim outMail As Outlook.MailItem
Set outMail = outlookApp.CreateItem(olMailItem)
With outMail
.CC = "xxxxxxxx"
.Subject = "xxxxxxxxxxxx"
End With
'Get its Word editor
outMail.Display
Dim wordDoc As Word.Document
Set wordDoc = outMail.GetInspector.WordEditor
'To paste as picture
wordDoc.Range.PasteAndFormat wdChartPicture
With wordDoc.InlineShapes(1)
.LockAspectRatio = msoFalse
.Height = 7.29 * 50
.Width = 15.28 * 50
End With
End Sub
The problem is that when I do this, the default signature for new emails disappears. I cannot hard code my email signature in because I will have multiple users using the macro and each has a unique signature. That's why I want to keep the default signature for new emails.
Can anyone help with this?
Sub Email()
'Copy range of interest
Dim r As Range
Set r = Range("A1:E24")
r.Copy
'Open a new mail item
Dim outlookApp As Outlook.Application
Set outlookApp = CreateObject("Outlook.Application")
Dim outMail As Outlook.MailItem
Set outMail = outlookApp.CreateItem(olMailItem)
With outMail
.CC = "xxxxxxxx"
.Subject = "xxxxxxxxxxxx"
End With
'Get its Word editor
outMail.Display
Dim wordDoc As Word.Document
Set wordDoc = outMail.GetInspector.WordEditor
'To paste as picture
wordDoc.Range.PasteAndFormat wdChartPicture
With wordDoc.InlineShapes(1)
.LockAspectRatio = msoFalse
.Height = 7.29 * 50
.Width = 15.28 * 50
End With
End Sub
The problem is that when I do this, the default signature for new emails disappears. I cannot hard code my email signature in because I will have multiple users using the macro and each has a unique signature. That's why I want to keep the default signature for new emails.
Can anyone help with this?