View Single Post
 
Old 02-07-2024, 01:34 AM
RRB's Avatar
RRB RRB is offline Windows 11 Office 2021
Susan Flamingo
 
Join Date: May 2014
Location: The Holy City of Jerusalem
Posts: 302
RRB is on a distinguished road
Default

I was actually able to do this myself, with a little assistance of recording a macro:

Dim MyText As String
MyText = Selection.Text
Selection.Style = ActiveDocument.Styles("MyStyle")

Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, _
Text:="TC """ & MyText & """ \l 3 ", PreserveFormatting:=False

Would you believe it actually works?!

I guess I am on my way to becoming the world's biggest expert in Word macros.

I have in the past actually written thousands of lines of code (Pascal, remember that?) but my meds have totally zapped my memory

Thank You again!

Susan Flamingo
Reply With Quote