F
frogman
I am trying to create a field code that looks like this:
{Macrobutton NoMacro {Quote "Insert Number" \* CharFormat}}
but if I just add the text the second Quote is just the text that is
added to the field. so I attempted to create a double field creation
but it failed.
Thank you for your help
Sub TextToFieldClear()
Dim strSelection As String
Dim intWordCount As Integer
Selection.Font.Color = wdColorRed
strSelection = Selection.Text
'intWordCount =
'intWordCount = Selection.Information(wdEndOfRangeRowNumber)
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty,
Text:="Macrobutton NoMacro " & strSelection & "",
PreserveFormatting:=False
'ActiveDocument.Words.Item(intWordCount).Select
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty,
Text:="" & strSelection & "" & " \* CharFormat",
PreserveFormatting:=False
Selection.Fields(1).Update
End Sub
{Macrobutton NoMacro {Quote "Insert Number" \* CharFormat}}
but if I just add the text the second Quote is just the text that is
added to the field. so I attempted to create a double field creation
but it failed.
Thank you for your help
Sub TextToFieldClear()
Dim strSelection As String
Dim intWordCount As Integer
Selection.Font.Color = wdColorRed
strSelection = Selection.Text
'intWordCount =
'intWordCount = Selection.Information(wdEndOfRangeRowNumber)
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty,
Text:="Macrobutton NoMacro " & strSelection & "",
PreserveFormatting:=False
'ActiveDocument.Words.Item(intWordCount).Select
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty,
Text:="" & strSelection & "" & " \* CharFormat",
PreserveFormatting:=False
Selection.Fields(1).Update
End Sub