View Single Post
 
Old 01-17-2021, 09:53 PM
macropod's Avatar
macropod macropod is offline Windows 10 Office 2016
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

Quote:
Originally Posted by SMehta View Post
Sir if i may ask what does the following mean

in Demo 1
Code:
  .Text = "[^13]{2,}"
  .Replacement.Text = "^p"
in Demo 2
Code:
  .Text = "[^13]{2}[!^13]*[^13]{2}"
  .Replacement.Text = "^p"
Those are standard Word wildcard Find/Replace expressions. See: Finding and replacing characters using wildcards
Quote:
Originally Posted by SMehta View Post
To check i inserted the both Demos in Module and ran the macro for Demo 1
i got following the error "438" Object doesnt suport this property at

DocTgt.Range.Characters.Last.Text = .Text
My bad. I omitted .Range from that line. Code fixed.
Quote:
Originally Posted by SMehta View Post
Something happened surprisingly when
I ran Demo 2
Everything disappeared from VBA programming enviornment Coding Editor
it just displayed Microsoft Visual Basic for Application - Sample
and main document White Page from word was also not seen
In both sets of code, the source document isn't visible while being processed. Everything should return to normal once the macro has finished executing.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote