#1
|
|||
|
|||
Copy / Print Merge code
Two questions:
1) Is there a way to copy and or print the merge code itself? I'd rather not type them all by hand (to much room for error with my fat fingers) Every time I've tried I get the value of the current record, NOT what I "see on screen". I understand that code can't be copied and pasted for use in a merge. I want to document them for my learning and also save the merge codes for those that might follow in my footsteps. 2) Is there a way to place comments in the code? Similar to using ' in VBA? Thanks! Scott |
#2
|
||||
|
||||
Copying mergefields from a mailmerge main document copies the fields, not whatever might be displayed as a result of a preview. If they're pasted into another, ordinary, document and the fields are updated there all you should see is the field names enclosed by their chevrons (i.e. « »)
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
Paul -
Just to make sure I was clear. What I want to print out is: {if {MERGEFIELD LVMass} < 200 {MERGEFIELD LVMass \# "0.00"} {MERGEFIELD LVMass \# "0.00"}} What happens when I copy and print to a "normal" word doc is: <<LVMass>> If that is as expected I guess my answer is no. Correct? |
#4
|
||||
|
||||
OK, you're copying more than just the mergefields - you're also copying IF fields that contain them. On their own, the mergefields will look like «LVMass». That's what you might also see when you copy one that's embedded in an IF field, but what you'll see in that case really depends on what the IF field is doing.
As for printing out the field codes, all that requires is checking Word's 'print field codes instead of their values' option. I missed would question about comments before - that can be done in either of two ways: {IF{ MERGEFIELD LVMass } < 200 { MERGEFIELD LVMass \# "0.00"} { MERGEFIELD LVMass \# "0.00"} {SET % Add comments here}} or {IF{ MERGEFIELD LVMass } < 200 { MERGEFIELD LVMass \# "0.00" } { MERGEFIELD LVMass \# "0.00"} /"Add Comments here"} The first version merely uses a SET field to add some comments to a % bookmark, which you can re-use as often as you like. The second version, though simpler, relies on an undocumented technique that can't be guaranteed to work in future Word versions.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#5
|
|||
|
|||
Just what I was looking (and looking, and looking) for!
For anyone else reading this in the future the setting macropod suggested: Quote:
Thanks!! |
Thread Tools | |
Display Modes | |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
If two geographical data match in two sheets, copy unique id/code found in one sheet | alliage | Excel | 1 | 09-01-2011 05:23 AM |
vba Code to Print Spreadsheet to PDF | OTPM | Excel Programming | 3 | 05-25-2011 08:22 AM |
Modify vba code to print based on name in the InputBox | OTPM | Project | 0 | 05-25-2011 02:03 AM |
VBA Code to Print Individual Resource Lists to a pdf File | OTPM | Project | 0 | 05-24-2011 12:21 PM |
Help - Word adds secret code? Copy to notepad? | andytaylor2006 | Word | 0 | 12-15-2006 11:00 PM |