At work every employee has their own signature set up, but it's not just text. There's logo with links along with the agent information. I use a macro built in excel to help agents with verifying all the information they need before they can send an email to the corresponding department they wish to contact.
At the end of the macro after they provide all the information in the Userform the macro will automatically pull up outlook and paste a message based on the info they provide in the userform. This makes it difficult to use the signature. I've made it so I can paste the signature as text, but the links get messy.
I have found that if I use the "Copy" function personally and paste it in Word it will paste as the picture instead of text. I know how to copy whatever is selected in the Outlook Email and paste it in word, but I have searched everywhere and was unable to find an answer.
I would like to be able to select all the text that comes up when the email generates and copy it so I can pull up word and paste it. That way I can put it back in after the text from the userform. Another reason why I sould like to do this is I would be able to avoid the message that comes up asking permission to access the information from outlook. This is what I have so far:
Sub Email_Generator()
X = "Hello," & vbCrLf & vbCrLf & "Needed verified info here" & vbCrLf & vbCrLf & "Thank you," & vbCrLf
Dim OutApp As Object
Dim OutMail As Object
Dim WordApp As Object
Set OutApp = CreateObject ("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
OutMail.display
'I want to do something like this
WordApp = CreateObject ("Word.Application")
WordApp.Document.Add
OutMail.body.Selection.Copy
WordApp.Selection.Paste
signature = WordApp.Selection
'But right now I'm doing this to make the signature work as best as I can with the hyperlinks and other jargon with it
signature = OutMail.body
With OutMail
.To = "department@workplace.com"
.CC = "TeamLead@workplace.com"
.body = X & signature
End With
End Sub
Bookmarks