Find and replace macro

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want to run a find and replace marco atthe end of a document as it is printed. It needs to find any 0.00 and replace with a blank. The 0.00s are fields in a table which have not been used. Word itself is being called by an external program which merges data into it and then prints it out. I have the macro working in Word but I think the timing is wrong to use it through the 3rd party software. Can anyone suggest a work round for this??
 
Scotty said:
I want to run a find and replace marco atthe end of a document as it is printed. It needs to find any 0.00 and replace with a blank. The 0.00s are fields in a table which have not been used. Word itself is being called by an external program which merges data into it and then prints it out. I have the macro working in Word but I think the timing is wrong to use it through the 3rd party software. Can anyone suggest a work round for this??

Hi Scotty,

It very much depends on how the 3rd part software is causing Word to
print, and how your macro is supposed to be started. It probably isn't
"timing", but that your macro isn't being called. There may or may not
be a way to get it to be called, but I can't tell without knowing a
lot more about both the program and the macro.

But you may not need a macro. If you're using mail-merge fields in the
table, use a numeric picture switch like this:

{ MERGEFIELD Salary \# ##,###.00;(##,###.00);"" }

The three parts, separated by semicolons, represent the formats used
when the merged number is positive, negative, or zero. The last one,
for a zero value, is just an empty pair of double quotes representing
"nothing".

These switches work with most other kinds of fields, too. Look up
"Numeric picture switch" in the Help for more info.
 
Thanks Jay I will try the switch as you suggested. I think though that you are right about the macro not being called. The document that is being merged does not contain the macro itself so I am going to recreate the template based on one with the maco in.
Thanks again!
 
Back
Top