Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
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
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
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
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
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
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
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
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
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
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
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 | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Converting WordPerfect 12 files to Word 2003 | New Users | |||
Why can't I get Multiple instances of word? | Microsoft Word Help | |||
I am having difficulty with deleting headers and footers | New Users | |||
glossary macro in Word? | Microsoft Word Help | |||
Macro for Letter Settings Help | New Users |