Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 10-31-2012, 08:59 PM
macropod's Avatar
macropod macropod is offline Ensure macro operates in the right doc window Windows 7 64bit Ensure macro operates in the right doc window Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Your code should run against whichever document is active at the time. That said, it could be reduced to:
Code:
Sub subCurlyQuots() 
' ' CurlyQuotes Macro ' ' With ActiveDocument.Content.Find .ClearFormatting .Replacement.ClearFormatting .Text = """" .Replacement.Text = "^&" .Forward = True .Wrap = wdFindContinue .Format = False .MatchCase = False .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False .Execute Replace:=wdReplaceAll .Text = "'" .Execute Replace:=wdReplaceAll End With
End Sub

PS: When posting code, please use the code tags. They're on the 'Go Advanced' tab.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Ensure macro operates in the right doc window Research window that won't go away. kaetsdz Word 3 08-08-2012 07:24 PM
Ensure macro operates in the right doc window ensure I have an 8.5x11 sheet Taylor Word 3 10-09-2011 12:39 AM
Ensure macro operates in the right doc window Problem with window Zakhary Word 1 05-22-2011 01:24 PM
Date pop-up window Roshan Hanief Word 0 04-23-2011 04:16 AM
Ensure macro operates in the right doc window How to ensure that each line ends only at the margin sparemejava Word 9 02-06-2011 03:21 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 06:35 PM.


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