Hi All!,

I am new to writing macros in Word/VBA. I have recorded a macro that
I need to repeat through the end of the document. All help is
appreciated.


Jon

Re: Record Copy and Paste Macro, want to repeat throughout the document by Klaus

Klaus
Thu Apr 12 15:06:24 CDT 2007

Hi Jon,

Write a bit more about what you want the macro to do...

You know you can copy stuff to the clipboard, and then replace some text
with the (formatted) clipboard content, using ^c in "Edit > Replace >
Replace with"?

Regards,
Klaus


<jon.jefferson@gmail.com> wrote:
> Hi All!,
>
> I am new to writing macros in Word/VBA. I have recorded a macro that
> I need to repeat through the end of the document. All help is
> appreciated.
>
>
> Jon
>



Re: Record Copy and Paste Macro, want to repeat throughout the document by JB

JB
Fri Apr 13 08:19:01 CDT 2007

On Apr 12, 4:06 pm, "Klaus Linke" <i...@fotosatz-kaufmann.de> wrote:
> Hi Jon,
>
> Write a bit more about what you want the macro to do...
>
> You know you can copy stuff to the clipboard, and then replace some text
> with the (formatted) clipboard content, using ^c in "Edit > Replace >
> Replace with"?
>
> Regards,
> Klaus
>
> <jon.jeffer...@gmail.com> wrote:
> > Hi All!,
>
> > I am new to writing macros in Word/VBA. I have recorded a macro that
> > I need to repeat through the end of the document. All help is
> > appreciated.
>
> > Jon

Klaus,

Thank you for responding. OK, here is the macro I recorded. What I
need to do via a macro is copy, paste and repeat throughout the entire
document. The format of the document is:

dn: cn=group,ou=org,o=root
changetype:modify
add:equivalentToMe
equivalentToMe:cn=name,o=root

replace:Member
Member:

I need the macro to copy and paste the "cn=" portion from
"equivalentToMe:" to "Member:"
The following macro works but I need it to repeat through the entire
file, or if you have a better way of doing what I need, that would
help as well.

Selection.Find.ClearFormatting
With Selection.Find
.Text = "cn=""*"""
.Replacement.Text = "oldr"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute
Selection.copy
Selection.EndKey Unit:=wdLine
Selection.Find.ClearFormatting
With Selection.Find
.Text = "newrdn:"
.Replacement.Text = "oldr"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.PasteAndFormat (wdPasteDefault)
Repeat
End Sub

Thank You,

Jon


Re: Record Copy and Paste Macro, want to repeat throughout the document by Klaus

Klaus
Fri Apr 13 09:02:49 CDT 2007

Hi Jon,

Your macro doesn't work with the sample you posted (there's no "newrdn:"),
so I'm not sure what it's supposed to do.

So let me make a sample that works...:

((Before))
~~~~~~~~~~~~
dn: cn=group,ou=org,o=root
changetype:modify
add:equivalentToMe
equivalentToMe:cn=name,o=root

replace:Member
Member:

~~~~~~~~~~~~

((After))
~~~~~~~~~~~~
dn: cn=group,ou=org,o=root
changetype:modify
add:equivalentToMe
equivalentToMe:cn=name,o=root

replace:Member
Member: cn=group

~~~~~~~~~~~~

You could do that with a wildcard replacement.
In the "Find/Replace" dialog, check "Match wildcards".

First, you'll have to figure out what you want to copy to the other
location, and put it in braces:
Find what: dn: (cn=[!,]@),

The braces allow you to re-insert that expression later.

Let's also match the following text, up to where we want to insert the
group:
dn:[!^13^11]@(cn=[!,]@),*Member:

(Instead of both [!^13^11]@ and [!,]@ you could also use the * wildcard, but
it's safter to restrict matches a bit)

Now, we want to leave everything as it was, and insert a blank and the stuff
from the second group:
Replace with: ^& \1

^& inserts the whole stuff you matched, \1 puts in what you matched in your
(first) braced expression.

If that's not what you had in mind, exactly, maybe you can figure out how to
adapt that wildcard replacement... or post back!

Regards,
Klaus



>> Write a bit more about what you want the macro to do...
>> You know you can copy stuff to the clipboard, and then replace some text
>> with the (formatted) clipboard content, using ^c in "Edit > Replace >
>> Replace with"?

"JB" <jon.jefferson@gmail.com> wrote:
>> > I am new to writing macros in Word/VBA. I have recorded a macro that
>> > I need to repeat through the end of the document. All help is
>> > appreciated.
>>
>> > Jon
>
> Klaus,
>
> Thank you for responding. OK, here is the macro I recorded. What I
> need to do via a macro is copy, paste and repeat throughout the entire
> document. The format of the document is:
>
> dn: cn=group,ou=org,o=root
> changetype:modify
> add:equivalentToMe
> equivalentToMe:cn=name,o=root
>
> replace:Member
> Member:
>
> I need the macro to copy and paste the "cn=" portion from
> "equivalentToMe:" to "Member:"
> The following macro works but I need it to repeat through the entire
> file, or if you have a better way of doing what I need, that would
> help as well.
>
> Selection.Find.ClearFormatting
> With Selection.Find
> .Text = "cn=""*"""
> .Replacement.Text = "oldr"
> .Forward = True
> .Wrap = wdFindContinue
> .Format = False
> .MatchCase = False
> .MatchWholeWord = False
> .MatchAllWordForms = False
> .MatchSoundsLike = False
> .MatchWildcards = True
> End With
> Selection.Find.Execute
> Selection.copy
> Selection.EndKey Unit:=wdLine
> Selection.Find.ClearFormatting
> With Selection.Find
> .Text = "newrdn:"
> .Replacement.Text = "oldr"
> .Forward = True
> .Wrap = wdFindContinue
> .Format = False
> .MatchCase = False
> .MatchWholeWord = False
> .MatchWildcards = False
> .MatchSoundsLike = False
> .MatchAllWordForms = False
> End With
> Selection.Find.Execute
> Selection.MoveRight Unit:=wdCharacter, Count:=1
> Selection.PasteAndFormat (wdPasteDefault)
> Repeat
> End Sub
>
> Thank You,
>
> Jon
>



Re: Record Copy and Paste Macro, want to repeat throughout the document by JB

JB
Fri Apr 13 10:42:57 CDT 2007

On Apr 13, 10:02 am, "Klaus Linke" <i...@fotosatz-kaufmann.de> wrote:
> Hi Jon,
>
> Your macro doesn't work with the sample you posted (there's no "newrdn:"),
> so I'm not sure what it's supposed to do.
>
> So let me make a sample that works...:
>
> ((Before))
> ~~~~~~~~~~~~
> dn: cn=group,ou=org,o=root
> changetype:modify
> add:equivalentToMe
> equivalentToMe:cn=name,o=root
>
> replace:Member
> Member:
>
> ~~~~~~~~~~~~
>
> ((After))
> ~~~~~~~~~~~~
> dn: cn=group,ou=org,o=root
> changetype:modify
> add:equivalentToMe
> equivalentToMe:cn=name,o=root
>
> replace:Member
> Member: cn=group
>
> ~~~~~~~~~~~~
>
> You could do that with a wildcard replacement.
> In the "Find/Replace" dialog, check "Match wildcards".
>
> First, you'll have to figure out what you want to copy to the other
> location, and put it in braces:
> Find what: dn: (cn=[!,]@),
>
> The braces allow you to re-insert that expression later.
>
> Let's also match the following text, up to where we want to insert the
> group:
> dn:[!^13^11]@(cn=[!,]@),*Member:
>
> (Instead of both [!^13^11]@ and [!,]@ you could also use the * wildcard, but
> it's safter to restrict matches a bit)
>
> Now, we want to leave everything as it was, and insert a blank and the stuff
> from the second group:
> Replace with: ^& \1
>
> ^& inserts the whole stuff you matched, \1 puts in what you matched in your
> (first) braced expression.
>
> If that's not what you had in mind, exactly, maybe you can figure out how to
> adapt that wildcard replacement... or post back!
>
> Regards,
> Klaus
>
> >> Write a bit more about what you want the macro to do...
> >> You know you can copy stuff to the clipboard, and then replace some text
> >> with the (formatted) clipboard content, using ^c in "Edit > Replace >
> >> Replace with"?
> "JB" <jon.jeffer...@gmail.com> wrote:
> >> > I am new to writing macros in Word/VBA. I have recorded a macro that
> >> > I need to repeat through the end of the document. All help is
> >> > appreciated.
>
> >> > Jon
>
> > Klaus,
>
> > Thank you for responding. OK, here is the macro I recorded. What I
> > need to do via a macro is copy, paste and repeat throughout the entire
> > document. The format of the document is:
>
> > dn: cn=group,ou=org,o=root
> > changetype:modify
> > add:equivalentToMe
> > equivalentToMe:cn=name,o=root
>
> > replace:Member
> > Member:
>
> > I need the macro to copy and paste the "cn=" portion from
> > "equivalentToMe:" to "Member:"
> > The following macro works but I need it to repeat through the entire
> > file, or if you have a better way of doing what I need, that would
> > help as well.
>
> > Selection.Find.ClearFormatting
> > With Selection.Find
> > .Text = "cn=""*"""
> > .Replacement.Text = "oldr"
> > .Forward = True
> > .Wrap = wdFindContinue
> > .Format = False
> > .MatchCase = False
> > .MatchWholeWord = False
> > .MatchAllWordForms = False
> > .MatchSoundsLike = False
> > .MatchWildcards = True
> > End With
> > Selection.Find.Execute
> > Selection.copy
> > Selection.EndKey Unit:=wdLine
> > Selection.Find.ClearFormatting
> > With Selection.Find
> > .Text = "newrdn:"
> > .Replacement.Text = "oldr"
> > .Forward = True
> > .Wrap = wdFindContinue
> > .Format = False
> > .MatchCase = False
> > .MatchWholeWord = False
> > .MatchWildcards = False
> > .MatchSoundsLike = False
> > .MatchAllWordForms = False
> > End With
> > Selection.Find.Execute
> > Selection.MoveRight Unit:=wdCharacter, Count:=1
> > Selection.PasteAndFormat (wdPasteDefault)
> > Repeat
> > End Sub
>
> > Thank You,
>
> > Jon
Klaus,

Sorry about the macro/example. But here is a more accurate example of
what the above script does:

(((Before))))

dn: cn=user1,o=root

changetype:moddn
newrdn:
deletoldrdn:1
newsuperior: ou=NewOU,o=root

(((After)))

dn: cn=user1,o=root

changetype:moddn
newrdn:cn=user1
deletoldrdn:1
newsuperior: ou=NewOU,o=root

What I would like to happen is actually repeat those steps throughout
the entire document because this (see above example) is just one entry
in the document. There are many many more throughout the document.
Now correct me if I misunderstand, but what you are telling to me to
do is place brackets here (cn=user1) and here: newrdn:( ). Then use
'Find/Replace', checking 'Use Wildcards' put in Find what: (*) (*)
and in the Replace with: field type in (\2) (\1). Is this correct?

thank you again,

Jon


Re: Record Copy and Paste Macro, want to repeat throughout the document by Klaus

Klaus
Fri Apr 13 12:57:15 CDT 2007

> (((Before))))
>
> dn: cn=user1,o=root
>
> changetype:moddn
> newrdn:
> deletoldrdn:1
> newsuperior: ou=NewOU,o=root
>
> (((After)))
>
> dn: cn=user1,o=root
>
> changetype:moddn
> newrdn:cn=user1
> deletoldrdn:1
> newsuperior: ou=NewOU,o=root


Hi Jon,

If I understand your sample, "cn=" always stays the same, in each record,
but "user1" may vary ... right?

First, we need to match "cn=user1" -- let's take the simplest wildcard
expression:
Find what: (cn=*)

... in brackets, so we can re-use it.
Then, we need to match more text, up to "newrdn:":
Find what: (cn=*),*newrdn:

We want to leave evberything we matched, but insert "cn=user1" after that:
Replace with: ^& \1

That should work, if all the records look like the sample. But it's a pretty
simple wildcard expression.
You could make it much more complex, but safer, say so that it never spans
more than one record, or observes other restrictions.

Regards,
Klaus



"JB" <jon.jefferson@gmail.com> schrieb im Newsbeitrag
news:1176478977.008851.87800@e65g2000hsc.googlegroups.com...
> On Apr 13, 10:02 am, "Klaus Linke" <i...@fotosatz-kaufmann.de> wrote:
>> Hi Jon,
>>
>> Your macro doesn't work with the sample you posted (there's no
>> "newrdn:"),
>> so I'm not sure what it's supposed to do.
>>
>> So let me make a sample that works...:
>>
>> ((Before))
>> ~~~~~~~~~~~~
>> dn: cn=group,ou=org,o=root
>> changetype:modify
>> add:equivalentToMe
>> equivalentToMe:cn=name,o=root
>>
>> replace:Member
>> Member:
>>
>> ~~~~~~~~~~~~
>>
>> ((After))
>> ~~~~~~~~~~~~
>> dn: cn=group,ou=org,o=root
>> changetype:modify
>> add:equivalentToMe
>> equivalentToMe:cn=name,o=root
>>
>> replace:Member
>> Member: cn=group
>>
>> ~~~~~~~~~~~~
>>
>> You could do that with a wildcard replacement.
>> In the "Find/Replace" dialog, check "Match wildcards".
>>
>> First, you'll have to figure out what you want to copy to the other
>> location, and put it in braces:
>> Find what: dn: (cn=[!,]@),
>>
>> The braces allow you to re-insert that expression later.
>>
>> Let's also match the following text, up to where we want to insert the
>> group:
>> dn:[!^13^11]@(cn=[!,]@),*Member:
>>
>> (Instead of both [!^13^11]@ and [!,]@ you could also use the * wildcard,
>> but
>> it's safter to restrict matches a bit)
>>
>> Now, we want to leave everything as it was, and insert a blank and the
>> stuff
>> from the second group:
>> Replace with: ^& \1
>>
>> ^& inserts the whole stuff you matched, \1 puts in what you matched in
>> your
>> (first) braced expression.
>>
>> If that's not what you had in mind, exactly, maybe you can figure out how
>> to
>> adapt that wildcard replacement... or post back!
>>
>> Regards,
>> Klaus
>>
>> >> Write a bit more about what you want the macro to do...
>> >> You know you can copy stuff to the clipboard, and then replace some
>> >> text
>> >> with the (formatted) clipboard content, using ^c in "Edit > Replace >
>> >> Replace with"?
>> "JB" <jon.jeffer...@gmail.com> wrote:
>> >> > I am new to writing macros in Word/VBA. I have recorded a macro
>> >> > that
>> >> > I need to repeat through the end of the document. All help is
>> >> > appreciated.
>>
>> >> > Jon
>>
>> > Klaus,
>>
>> > Thank you for responding. OK, here is the macro I recorded. What I
>> > need to do via a macro is copy, paste and repeat throughout the entire
>> > document. The format of the document is:
>>
>> > dn: cn=group,ou=org,o=root
>> > changetype:modify
>> > add:equivalentToMe
>> > equivalentToMe:cn=name,o=root
>>
>> > replace:Member
>> > Member:
>>
>> > I need the macro to copy and paste the "cn=" portion from
>> > "equivalentToMe:" to "Member:"
>> > The following macro works but I need it to repeat through the entire
>> > file, or if you have a better way of doing what I need, that would
>> > help as well.
>>
>> > Selection.Find.ClearFormatting
>> > With Selection.Find
>> > .Text = "cn=""*"""
>> > .Replacement.Text = "oldr"
>> > .Forward = True
>> > .Wrap = wdFindContinue
>> > .Format = False
>> > .MatchCase = False
>> > .MatchWholeWord = False
>> > .MatchAllWordForms = False
>> > .MatchSoundsLike = False
>> > .MatchWildcards = True
>> > End With
>> > Selection.Find.Execute
>> > Selection.copy
>> > Selection.EndKey Unit:=wdLine
>> > Selection.Find.ClearFormatting
>> > With Selection.Find
>> > .Text = "newrdn:"
>> > .Replacement.Text = "oldr"
>> > .Forward = True
>> > .Wrap = wdFindContinue
>> > .Format = False
>> > .MatchCase = False
>> > .MatchWholeWord = False
>> > .MatchWildcards = False
>> > .MatchSoundsLike = False
>> > .MatchAllWordForms = False
>> > End With
>> > Selection.Find.Execute
>> > Selection.MoveRight Unit:=wdCharacter, Count:=1
>> > Selection.PasteAndFormat (wdPasteDefault)
>> > Repeat
>> > End Sub
>>
>> > Thank You,
>>
>> > Jon
> Klaus,
>
> Sorry about the macro/example. But here is a more accurate example of
> what the above script does:
>
> (((Before))))
>
> dn: cn=user1,o=root
>
> changetype:moddn
> newrdn:
> deletoldrdn:1
> newsuperior: ou=NewOU,o=root
>
> (((After)))
>
> dn: cn=user1,o=root
>
> changetype:moddn
> newrdn:cn=user1
> deletoldrdn:1
> newsuperior: ou=NewOU,o=root
>
> What I would like to happen is actually repeat those steps throughout
> the entire document because this (see above example) is just one entry
> in the document. There are many many more throughout the document.
> Now correct me if I misunderstand, but what you are telling to me to
> do is place brackets here (cn=user1) and here: newrdn:( ). Then use
> 'Find/Replace', checking 'Use Wildcards' put in Find what: (*) (*)
> and in the Replace with: field type in (\2) (\1). Is this correct?
>
> thank you again,
>
> Jon
>



Re: Record Copy and Paste Macro, want to repeat throughout the document by JB

JB
Tue Apr 17 14:50:31 CDT 2007

On Apr 13, 1:57 pm, "Klaus Linke" <i...@fotosatz-kaufmann.de> wrote:
> > (((Before))))
>
> > dn: cn=user1,o=root
>
> > changetype:moddn
> > newrdn:
> > deletoldrdn:1
> > newsuperior: ou=NewOU,o=root
>
> > (((After)))
>
> > dn: cn=user1,o=root
>
> > changetype:moddn
> > newrdn:cn=user1
> > deletoldrdn:1
> > newsuperior: ou=NewOU,o=root
>
> Hi Jon,
>
> If I understand your sample, "cn=" always stays the same, in each record,
> but "user1" may vary ... right?
>
> First, we need to match "cn=user1" -- let's take the simplest wildcard
> expression:
> Find what: (cn=*)
>
> ... in brackets, so we can re-use it.
> Then, we need to match more text, up to "newrdn:":
> Find what: (cn=*),*newrdn:
>
> We want to leave evberything we matched, but insert "cn=user1" after that:
> Replace with: ^& \1
>
> That should work, if all the records look like the sample. But it's a pretty
> simple wildcard expression.
> You could make it much more complex, but safer, say so that it never spans
> more than one record, or observes other restrictions.
>
> Regards,
> Klaus
>
> "JB" <jon.jeffer...@gmail.com> schrieb im Newsbeitragnews:1176478977.008851.87800@e65g2000hsc.googlegroups.com...
>
> > On Apr 13, 10:02 am, "Klaus Linke" <i...@fotosatz-kaufmann.de> wrote:
> >> Hi Jon,
>
> >> Your macro doesn't work with the sample you posted (there's no
> >> "newrdn:"),
> >> so I'm not sure what it's supposed to do.
>
> >> So let me make a sample that works...:
>
> >> ((Before))
> >> ~~~~~~~~~~~~
> >> dn: cn=group,ou=org,o=root
> >> changetype:modify
> >> add:equivalentToMe
> >> equivalentToMe:cn=name,o=root
>
> >> replace:Member
> >> Member:
>
> >> ~~~~~~~~~~~~
>
> >> ((After))
> >> ~~~~~~~~~~~~
> >> dn: cn=group,ou=org,o=root
> >> changetype:modify
> >> add:equivalentToMe
> >> equivalentToMe:cn=name,o=root
>
> >> replace:Member
> >> Member: cn=group
>
> >> ~~~~~~~~~~~~
>
> >> You could do that with a wildcard replacement.
> >> In the "Find/Replace" dialog, check "Match wildcards".
>
> >> First, you'll have to figure out what you want to copy to the other
> >> location, and put it in braces:
> >> Find what: dn: (cn=[!,]@),
>
> >> The braces allow you to re-insert that expression later.
>
> >> Let's also match the following text, up to where we want to insert the
> >> group:
> >> dn:[!^13^11]@(cn=[!,]@),*Member:
>
> >> (Instead of both [!^13^11]@ and [!,]@ you could also use the * wildcard,
> >> but
> >> it's safter to restrict matches a bit)
>
> >> Now, we want to leave everything as it was, and insert a blank and the
> >> stuff
> >> from the second group:
> >> Replace with: ^& \1
>
> >> ^& inserts the whole stuff you matched, \1 puts in what you matched in
> >> your
> >> (first) braced expression.
>
> >> If that's not what you had in mind, exactly, maybe you can figure out how
> >> to
> >> adapt that wildcard replacement... or post back!
>
> >> Regards,
> >> Klaus
>
> >> >> Write a bit more about what you want the macro to do...
> >> >> You know you can copy stuff to the clipboard, and then replace some
> >> >> text
> >> >> with the (formatted) clipboard content, using ^c in "Edit > Replace >
> >> >> Replace with"?
> >> "JB" <jon.jeffer...@gmail.com> wrote:
> >> >> > I am new to writing macros in Word/VBA. I have recorded a macro
> >> >> > that
> >> >> > I need to repeat through the end of the document. All help is
> >> >> > appreciated.
>
> >> >> > Jon
>
> >> > Klaus,
>
> >> > Thank you for responding. OK, here is the macro I recorded. What I
> >> > need to do via a macro is copy, paste and repeat throughout the entire
> >> > document. The format of the document is:
>
> >> > dn: cn=group,ou=org,o=root
> >> > changetype:modify
> >> > add:equivalentToMe
> >> > equivalentToMe:cn=name,o=root
>
> >> > replace:Member
> >> > Member:
>
> >> > I need the macro to copy and paste the "cn=" portion from
> >> > "equivalentToMe:" to "Member:"
> >> > The following macro works but I need it to repeat through the entire
> >> > file, or if you have a better way of doing what I need, that would
> >> > help as well.
>
> >> > Selection.Find.ClearFormatting
> >> > With Selection.Find
> >> > .Text = "cn=""*"""
> >> > .Replacement.Text = "oldr"
> >> > .Forward = True
> >> > .Wrap = wdFindContinue
> >> > .Format = False
> >> > .MatchCase = False
> >> > .MatchWholeWord = False
> >> > .MatchAllWordForms = False
> >> > .MatchSoundsLike = False
> >> > .MatchWildcards = True
> >> > End With
> >> > Selection.Find.Execute
> >> > Selection.copy
> >> > Selection.EndKey Unit:=wdLine
> >> > Selection.Find.ClearFormatting
> >> > With Selection.Find
> >> > .Text = "newrdn:"
> >> > .Replacement.Text = "oldr"
> >> > .Forward = True
> >> > .Wrap = wdFindContinue
> >> > .Format = False
> >> > .MatchCase = False
> >> > .MatchWholeWord = False
> >> > .MatchWildcards = False
> >> > .MatchSoundsLike = False
> >> > .MatchAllWordForms = False
> >> > End With
> >> > Selection.Find.Execute
> >> > Selection.MoveRight Unit:=wdCharacter, Count:=1
> >> > Selection.PasteAndFormat (wdPasteDefault)
> >> > Repeat
> >> > End Sub
>
> >> > Thank You,
>
> >> > Jon
> > Klaus,
>
> > Sorry about the macro/example. But here is a more accurate example of
> > what the above script does:
>
> > (((Before))))
>
> > dn: cn=user1,o=root
>
> > changetype:moddn
> > newrdn:
> > deletoldrdn:1
> > newsuperior: ou=NewOU,o=root
>
> > (((After)))
>
> > dn: cn=user1,o=root
>
> > changetype:moddn
> > newrdn:cn=user1
> > deletoldrdn:1
> > newsuperior: ou=NewOU,o=root
>
> > What I would like to happen is actually repeat those steps throughout
> > the entire document because this (see above example) is just one entry
> > in the document. There are many many more throughout the document.
> > Now correct me if I misunderstand, but what you are telling to me to
> > do is place brackets here (cn=user1) and here: newrdn:( ). Then use
> > 'Find/Replace', checking 'Use Wildcards' put in Find what: (*) (*)
> > and in the Replace with: field type in (\2) (\1). Is this correct?
>
> > thank you again,
>
> > Jon

Klaus,

Thank you for your help and advice, I appreciate it!

sincerely,

Jon


Re: Record Copy and Paste Macro, want to repeat throughout the document by Klaus

Klaus
Tue Apr 17 15:25:22 CDT 2007

Hi Jon,

Glad if it did help... I wasn't so sure about what your requirements were.
Wildcard replacements are really sweet, if you've gotten beyond the initial
hurdles.
You could do much the same thing with string functions (Instr, Left, Like
...), but it's often more difficult and debug such macros than to write a
wildcard replacement (... if it doesn't work the first time, you just
Undo -- Ctrl+Z -- and try once more). Same with copy/paste, which likely
also has some speed penalty, when you work with large documents.

Regards,
Klaus