Microsoft Office Tutorials and References
In Depth Information
Copying Nested Field Codes as Text
Figure 48 – Nested Field Codes Pasted as Text
View the Appendix to learn how to store this procedure
in a Standard module.
Option explicit¶
' * * * * *¶
Function InsertFieldInFieldCode( _¶
ByRef rng As Word.Range, _¶
ByRef szBkm As String, _¶
ByRef szField As String, _¶
Optional ByRef PF As Boolean = False) As Boolean¶
InsertFieldInFieldCode = False¶
With rng.Find¶
.Text = szBkm¶
If .Found Then¶
ActiveDocument.Fields.Add _¶
Range:=rng, Text:=szField, _¶
InsertFieldInFieldCode = True¶
End If¶
End With¶
End Function¶
' * * * * *¶
Sub PasteFieldCodesAsText()¶
'Variable declaration¶
Dim rng As Word.Range¶
Dim FieldString As String¶
Dim NewString As String¶
Search JabSto ::

Custom Search