![]() |
|
#4
|
||||
|
||||
|
You won't have to unprotect the form if you process the copied data in the message as it will already be unprotected there e.g. as follows.
You can change the wingding characters to those you prefer. Code:
Option Explicit
Private Sub EmailData()
Dim OutApp As Object
Dim OutMail As Object
Dim OutInsp As Object
Dim OutDoc As Word.Document
Dim oFld As Word.FormField
Dim oRng As Word.Range
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
ActiveDocument.Content.Copy
OutDoc.Range.PasteAndFormat Type:=wdFormatOriginalFormatting
For Each oFld In OutDoc.Range.FormFields
Set oRng = oFld.Range
If oFld.Type = wdFieldFormCheckBox Then
If oFld.CheckBox.Value = True Then
oRng.InsertSymbol _
Font:="Wingdings", _
CharacterNumber:=-3842, _
Unicode:=True
Else
oRng.InsertSymbol _
Font:="Wingdings", _
CharacterNumber:=-3985, _
Unicode:=True
End If
Else
oRng.Text = oFld.Result
End If
Next oFld
Set oFld = Nothing
Set oRng = Nothing
Set OutInsp = Nothing
Set OutMail = Nothing
Set OutDoc = Nothing
Set OutApp = Nothing
End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Formfield calculation
|
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 |
Checkbox on Userform result in Text in Word
|
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 |