![]() |
|
|
|
#1
|
|||
|
|||
|
Sub ScratchMacro()
'A basic Word macro coded by Greg Maxey Dim strFind() As String Dim i As Long Dim oRng As Word.Range strFind = Split("this student|a student|my student|student", "|") For i = 0 To UBound(strFind) Set oRng = ActiveDocument.Range With oRng.Find .ClearFormatting .Text = strFind(i) .MatchWholeWord = True .MatchCase = False While .Execute oRng.Select If MsgBox("Process this instance", vbYesNo, "Process?") = vbYes Then oRng.Text = "whatever" End If Wend End With Next i End Sub |
|
| Tags |
| content control, vba in microsoft word, word 2007 |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Macro to find text and replace with form field containing that text
|
iiiiifffff | Word VBA | 16 | 06-04-2016 01:47 AM |
| How to Rename a Quick Part | sleake | Word | 14 | 10-14-2013 09:21 AM |
| quick replace, sort, change columns | userman | Excel | 1 | 05-01-2012 06:24 AM |
| Quick change for all text boxes in a presentation | tmlander | PowerPoint | 1 | 03-09-2012 01:20 AM |
| Date display in Mod quick part header | Jrul John | Word | 1 | 08-02-2010 12:17 PM |