Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #14  
Old 02-07-2024, 01:34 AM
RRB's Avatar
RRB RRB is offline Looking for Macro Windows 11 Looking for Macro Office 2021
Susan Flamingo
Looking for Macro
 
Join Date: May 2014
Location: The Holy City of Jerusalem
Posts: 301
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
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Perfect macro not working when its code is inserted in larger macro RobiNew Word VBA 3 10-18-2023 03:19 AM
Macro to Remove Paras with Line Spac 6; Macro to Convert Paragraphs to Outline Numbered venganewt Word VBA 0 01-25-2022 06:28 PM
Looking for Macro Footnote extraction macro [Why is this macro so slow? / anyway to make it faster?] Le_Blanc Word VBA 10 03-22-2021 11:38 AM
Spell check macro within macro button field doesn't work in one document samuelle Word VBA 0 07-20-2016 02:27 AM
Looking for Macro Macro Question: Need help making a macro to highlight the first word in every sentence LadyAna Word 1 12-06-2014 10:39 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 09:47 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft