![]() |
|
#2
|
|||
|
|||
|
Add a formatting switch:
Code:
Sub ScratchMacro() 'A basic Word macro coded by Greg Maxey, http://gregmaxey.com/word_tips.html, 7/10/2017 Dim oFld As Field For Each oFld In ActiveDocument.Fields If oFld.Type = 3 Then oFld.Select If Not InStr(oFld.Code.Text, "\* Lower") > 0 Then If MsgBox("Format with lower case?", vbQuestion + vbYesNo, "FORMAT") = vbYes Then If InStr(oFld.Code.Text, "\h") > 0 Then oFld.Code.Text = Replace(oFld.Code.Text, "\h", "\* Lower \h") End If oFld.Update End If Else If MsgBox("Format with upper case?", vbQuestion + vbYesNo, "FORMAT") = vbYes Then If InStr(oFld.Code.Text, "\h") > 0 Then oFld.Code.Text = Replace(oFld.Code.Text, "\* Lower \h", "\h") End If oFld.Update End If End If End If Next End Sub lbl_Exit: Exit Sub End Sub |
| Tags |
| cross-reference, macro, unlink |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Cross Reference REF fields Unlink
|
mktate | Word VBA | 7 | 06-24-2016 05:55 AM |
| Cross reference is bad. | Leffken | Word | 1 | 06-09-2016 03:12 PM |
Totaling specific configuration selections that cross reference multiple fields (tricky)
|
lonniepoet | Excel Programming | 1 | 06-09-2016 09:54 AM |
Reference number and cross reference for equation numbers to match the thesis format
|
wmac | Word | 1 | 05-14-2013 08:54 PM |
| manipulating cross-reference fields | _wim_ | Word | 0 | 12-10-2010 05:52 AM |