![]() |
#1
|
|||
|
|||
![]()
I have a userform that has text and formfields mixed in. I would like to copy the text and the contents of the legacy formfields into an Outlook email message, while keeping the text formatting (bold, italic, underline, etc..). I did some research and found code that almost does what I need but it's pasting the formfield as a formfield and not as text.
Any help on how to modify the code to do this would be greatly appreciated. Private Sub EmailData() Dim OutApp As Object Dim OutMail As Object Dim OutInsp As Outlook.Inspector Dim WdApp As Word.Application Dim OutDoc As Word.Document Dim WdSel As Word.Selection Set OutApp = CreateObject("Outlook.Application") Set OutMail = OutApp.CreateItem(0) With OutMail .To = "EmailAddressHere" .Subject = "SubjectHere" .Display End With Set OutInsp = OutMail.GetInspector Set OutDoc = OutInsp.WordEditor Set WdApp = OutDoc.Application Set WdSel = WdApp.Selection ActiveDocument.Content.Copy WdSel.PasteAndFormat Type:=wdFormatOriginalFormatting Set WdSel = Nothing Set OutInsp = Nothing Set OutMail = Nothing Set OutDoc = Nothing Set WdApp = Nothing Set OutApp = Nothing End Sub |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
Joachim | Word | 4 | 03-08-2013 01:56 AM |
Copy all comments & cell contents (i.e. data) to word? | IanM | Excel | 0 | 07-03-2010 11:14 PM |
Copy the contents of a dcoument and paste it several times in a new document | Gerjanst | Word VBA | 0 | 06-30-2010 12:51 PM |
![]() |
Dolfie_twee | Word VBA | 1 | 06-22-2010 07:54 AM |
Auto populate formfield from dropdown menu | jmofstead | Word | 0 | 02-26-2010 10:35 AM |