View Single Post
  #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.