Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
Daire Daire is offline
external usenet poster
 
Posts: 3
Default Word 200 Macro using replace

Hi,

I have been searching the web for a solution to my problem but can't find
what I want - I hope someone here can help.

I have a .dot file that is used for creating new .doc files. I want to
create a macro that will run automatically everytime a new .doc file is
created to replace carraige returns in a particular table with spaces.

My macro goes something like this:
1. Edit Find 'Extra Description' [I know that the block of text I want
to perform the replace in is in the next field to 'Extra description']
2. Tab into the next field [where the block of text I want to perform the
replace in is]
3. Perform a Replace, replacing Paragraph Marks with a space.

My problem is this - when you do a replace, you are prompted with "Word has
finished searching the selection. XX replacements were made. Do you want to
search the remainder of the document?". When I record the macro, I click No
on this prompt and stop recording the macro. However, when I run the macro, I
still get the prompt. My clicking on No does not seem to be registered as
part of the macro.

Does anyone know a way around this?

Thanks.
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default Word 200 Macro using replace

If it is a template, why don't you simply delete the returns in the
template, then they won't be present in the new document?

The macro recorder has limitations. Open your macro and edit it - then
change the line
..Wrap = wdFindAsk
to
..Wrap = wdFindStop
http://www.gmayor.com/installing_macro.htm
which will address the current issue.

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


Daire wrote:
Hi,

I have been searching the web for a solution to my problem but can't
find what I want - I hope someone here can help.

I have a .dot file that is used for creating new .doc files. I want to
create a macro that will run automatically everytime a new .doc file
is created to replace carraige returns in a particular table with
spaces.

My macro goes something like this:
1. Edit Find 'Extra Description' [I know that the block of text I
want to perform the replace in is in the next field to 'Extra
description']
2. Tab into the next field [where the block of text I want to perform
the replace in is]
3. Perform a Replace, replacing Paragraph Marks with a space.

My problem is this - when you do a replace, you are prompted with
"Word has finished searching the selection. XX replacements were
made. Do you want to search the remainder of the document?". When I
record the macro, I click No on this prompt and stop recording the
macro. However, when I run the macro, I still get the prompt. My
clicking on No does not seem to be registered as part of the macro.

Does anyone know a way around this?

Thanks.



  #3   Report Post  
Posted to microsoft.public.word.docmanagement
Tony Jollans Tony Jollans is offline
external usenet poster
 
Posts: 1,308
Default Word 200 Macro using replace

Perhaps I'm missing the obvious but running a macro to manipulate the
contents of a new document this way seems pointless - can't you just make
the template the way you want it in the first place and dispense with the
macro?

--
Enjoy,
Tony

"Daire" wrote in message
...
Hi,

I have been searching the web for a solution to my problem but can't find
what I want - I hope someone here can help.

I have a .dot file that is used for creating new .doc files. I want to
create a macro that will run automatically everytime a new .doc file is
created to replace carraige returns in a particular table with spaces.

My macro goes something like this:
1. Edit Find 'Extra Description' [I know that the block of text I want
to perform the replace in is in the next field to 'Extra description']
2. Tab into the next field [where the block of text I want to perform the
replace in is]
3. Perform a Replace, replacing Paragraph Marks with a space.

My problem is this - when you do a replace, you are prompted with "Word
has
finished searching the selection. XX replacements were made. Do you want
to
search the remainder of the document?". When I record the macro, I click
No
on this prompt and stop recording the macro. However, when I run the
macro, I
still get the prompt. My clicking on No does not seem to be registered as
part of the macro.

Does anyone know a way around this?

Thanks.


  #4   Report Post  
Posted to microsoft.public.word.docmanagement
Daire Daire is offline
external usenet poster
 
Posts: 3
Default Word 200 Macro using replace

cheers Graham, that seems to have done the trick!

By the way, I couldn't delete the returns in the template as the data in
this field is populated from different fields in an XML file. The carraige
returns aren't part of the template, they come from the XML file.



"Graham Mayor" wrote:

If it is a template, why don't you simply delete the returns in the
template, then they won't be present in the new document?

The macro recorder has limitations. Open your macro and edit it - then
change the line
..Wrap = wdFindAsk
to
..Wrap = wdFindStop
http://www.gmayor.com/installing_macro.htm
which will address the current issue.

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


Daire wrote:
Hi,

I have been searching the web for a solution to my problem but can't
find what I want - I hope someone here can help.

I have a .dot file that is used for creating new .doc files. I want to
create a macro that will run automatically everytime a new .doc file
is created to replace carraige returns in a particular table with
spaces.

My macro goes something like this:
1. Edit Find 'Extra Description' [I know that the block of text I
want to perform the replace in is in the next field to 'Extra
description']
2. Tab into the next field [where the block of text I want to perform
the replace in is]
3. Perform a Replace, replacing Paragraph Marks with a space.

My problem is this - when you do a replace, you are prompted with
"Word has finished searching the selection. XX replacements were
made. Do you want to search the remainder of the document?". When I
record the macro, I click No on this prompt and stop recording the
macro. However, when I run the macro, I still get the prompt. My
clicking on No does not seem to be registered as part of the macro.

Does anyone know a way around this?

Thanks.




  #5   Report Post  
Posted to microsoft.public.word.docmanagement
Daire Daire is offline
external usenet poster
 
Posts: 3
Default Word 200 Macro using replace

Hi Tony,

As per my response to Graham's post:

"By the way, I couldn't delete the returns in the template as the data in
this field is populated from different fields in an XML file. The carraige
returns aren't part of the template, they come from the XML file".

Don't even ask about deleting the carraige returns from the XML file - long
story!

"Tony Jollans" wrote:

Perhaps I'm missing the obvious but running a macro to manipulate the
contents of a new document this way seems pointless - can't you just make
the template the way you want it in the first place and dispense with the
macro?

--
Enjoy,
Tony

"Daire" wrote in message
...
Hi,

I have been searching the web for a solution to my problem but can't find
what I want - I hope someone here can help.

I have a .dot file that is used for creating new .doc files. I want to
create a macro that will run automatically everytime a new .doc file is
created to replace carraige returns in a particular table with spaces.

My macro goes something like this:
1. Edit Find 'Extra Description' [I know that the block of text I want
to perform the replace in is in the next field to 'Extra description']
2. Tab into the next field [where the block of text I want to perform the
replace in is]
3. Perform a Replace, replacing Paragraph Marks with a space.

My problem is this - when you do a replace, you are prompted with "Word
has
finished searching the selection. XX replacements were made. Do you want
to
search the remainder of the document?". When I record the macro, I click
No
on this prompt and stop recording the macro. However, when I run the
macro, I
still get the prompt. My clicking on No does not seem to be registered as
part of the macro.

Does anyone know a way around this?

Thanks.





  #6   Report Post  
Posted to microsoft.public.word.docmanagement
Tony Jollans Tony Jollans is offline
external usenet poster
 
Posts: 1,308
Default Word 200 Macro using replace

"By the way, I couldn't delete the returns in the template as the data in
this field is populated from different fields in an XML file. The carraige
returns aren't part of the template, they come from the XML file".


I can see xml becoming an important factor in working with documents - I'd
better learn it quickly!

Don't even ask about deleting the carraige returns from the XML file -
long
story!


It always is - LOL!

--
Enjoy,
Tony

"Daire" wrote in message
...
Hi Tony,

As per my response to Graham's post:

"By the way, I couldn't delete the returns in the template as the data in
this field is populated from different fields in an XML file. The carraige
returns aren't part of the template, they come from the XML file".

Don't even ask about deleting the carraige returns from the XML file -
long
story!

"Tony Jollans" wrote:

Perhaps I'm missing the obvious but running a macro to manipulate the
contents of a new document this way seems pointless - can't you just make
the template the way you want it in the first place and dispense with the
macro?

--
Enjoy,
Tony

"Daire" wrote in message
...
Hi,

I have been searching the web for a solution to my problem but can't
find
what I want - I hope someone here can help.

I have a .dot file that is used for creating new .doc files. I want to
create a macro that will run automatically everytime a new .doc file is
created to replace carraige returns in a particular table with spaces.

My macro goes something like this:
1. Edit Find 'Extra Description' [I know that the block of text I
want
to perform the replace in is in the next field to 'Extra description']
2. Tab into the next field [where the block of text I want to perform
the
replace in is]
3. Perform a Replace, replacing Paragraph Marks with a space.

My problem is this - when you do a replace, you are prompted with "Word
has
finished searching the selection. XX replacements were made. Do you
want
to
search the remainder of the document?". When I record the macro, I
click
No
on this prompt and stop recording the macro. However, when I run the
macro, I
still get the prompt. My clicking on No does not seem to be registered
as
part of the macro.

Does anyone know a way around this?

Thanks.




Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Converting WordPerfect 12 files to Word 2003 Curious New Users 4 May 19th 23 02:48 PM
Why can't I get Multiple instances of word? Laverne Microsoft Word Help 14 November 17th 06 01:35 PM
I am having difficulty with deleting headers and footers LHD New Users 5 July 24th 06 01:44 AM
glossary macro in Word? Tipuana Microsoft Word Help 7 June 10th 06 07:06 PM
Macro for Letter Settings Help Renee Cabets New Users 7 May 25th 06 10:50 PM


All times are GMT +1. The time now is 09:01 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"