Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #16  
Old 06-08-2012, 09:13 PM
macropod's Avatar
macropod macropod is offline Macro help Windows 7 64bit Macro help Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
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


Hi redzan,

Try:
Code:
Sub Demo()
Application.ScreenUpdating = False
With ActiveDocument.Content
  With .Find
    .ClearFormatting
    .Replacement.ClearFormatting
    .Text = "ACCESSION: ([!^13]{1,})*: ([!^13]{1,})*: ([!^13]{1,})*: ([!^13]{1,})"
    .Replacement.Text = "###\1," & Format(Now, "MM/DD/YYYY") & ",\3,\4"
    .Forward = True
    .Wrap = wdFindContinue
    .Format = False
    .MatchCase = False
    .MatchWholeWord = False
    .MatchAllWordForms = False
    .MatchSoundsLike = False
    .MatchWildcards = True
    .Execute Replace:=wdReplaceAll
    .Text = "(###[!^13 ]{1,})[ ]{1,}(*^13)"
    .Replacement.Text = "\1\2"
    .Execute Replace:=wdReplaceAll
    .Execute
  End With
  Do While .Find.Found
    .Text = Replace(.Duplicate.Text, " ", "")
    .Collapse wdCollapseEnd
    .Find.Execute
  Loop
End With
Application.ScreenUpdating = True
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #17  
Old 06-08-2012, 09:20 PM
redzan redzan is offline Macro help Windows 7 32bit Macro help Office 2003
Advanced Beginner
Macro help
 
Join Date: Feb 2012
Posts: 37
redzan is on a distinguished road
Default

Works Beautifully. Thank you once again.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I assign a macro to a button when the macro is in my personal workbook? foolios Excel Programming 2 07-27-2011 02:41 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:29 AM.


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