Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #9  
Old 12-12-2012, 07:05 PM
gmaxey gmaxey is offline Replace text with Quick Part using VBA Windows 7 32bit Replace text with Quick Part using VBA Office 2010 (Version 14.0)
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,617
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

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
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
 

Tags
content control, vba in microsoft word, word 2007

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Replace text with Quick Part using VBA 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

Other Forums: Access Forums

All times are GMT -7. The time now is 02:19 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