#1
|
|||
|
|||
Mergefield - Replace Prefix of Document Number
Hi, i need help on this:
Field Name: DocNumber Sample of DocNumber (this is actually the invoice number): INV-0001 INV-0002 INV-0003 INV-0004 I making use of this mergefield «DocNumber» to create my DeliveryOrder bearing SAME numbering, however i need it to be in different "Prefix" as per below: DO-0001 DO-0002 DO-0003 DO-0004 Please help. Thanks. Boon Lai |
#2
|
||||
|
||||
Simple:
1. Select your «DocNumber» mergefield and press Shift-F9. You should see: { MERGEFIELD DocNumber } 2. Edit the field code so you end up with: { MERGEFIELD DocNumber \# "'DO'0000" } 3. Press F9 to update the field. Done.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
Hi Paul, thanks for your reply.
I tried as per your suggestion, here is what amended: { MERGEFIELD DocNumber \# "'DO-'0000" } however, the result was still not as desired. By the way, below the original, just in case this will help to indicate what goes wrong. { MERGEFIELD DocNumber \* MERGEFORMAT } Hope you can help again. Thanks. Boon Lai |
#4
|
||||
|
||||
Delete the '-'. You can also ditch the '\* MERGEFORMAT' switch.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#5
|
||||
|
||||
Or keep the hyphen and use
DO-{ MERGEFIELD "DocNumber" \# "0000"}
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
#6
|
|||
|
|||
Hi, thank you for your suggestions.
I tried all of your suggestion, but still did not get what i desired. Let me show you the result i get so far, 1. Original Result before any amendment: INV-0001 2. Result after amendment as per Paul: INV-0001 3. Result after amendment as per Graham: DO-INV-0001 Hope you can help to identify where goes wrong please. thanks again. Boon Lai |
#7
|
||||
|
||||
Either approach, done correctly, will generate DO-0001. I can only conclude you haven't followed the instructions. Without actually seeing the problem mailmerge main document, it can be difficult for anyone to diagnose the issue. Can you attach the mailmerge main document to a post (delete anything sensitive)? You do this via the paperclip symbol on the 'Go Advanced' tab at the bottom of this screen.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#8
|
|||
|
|||
Hi Paul,
thanks for your feedback, refer the attached. Page 1: Highlighted in Yellow, this is the original Invoice No based on <<DocNumber>> and required NO transformation. the result is INV-0001 (this one is totally fine). Page 2: Highlighted in Green, this is the DO No, to be based on <<DocNumber>> which required transformation we discussed above, the expected result should be DO-0001 and have yet to get the desired outcome. Thanks again. Boon Lai |
#9
|
||||
|
||||
You're using Graham's version of the field, which should work just fine. Did you in fact refresh the field display as I advised in post #2 and are you actually completing the merge?
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#10
|
|||
|
|||
Hi Paul,
Yes, i did completing the merge by right-click > Update Field. done this with suggestion from both of you. What could be the issue? Thanks. Boon Lai |
#11
|
||||
|
||||
Try completing the merge. Updating fields doesn't do that.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#12
|
||||
|
||||
If the data contains INV-0001 (or INV-1) then the switch \# "0000" will produce
-0001. You can add INV or DO to this, as a prefix, as appropriate. DO{ MERGEFIELD DocNumber \#"0000" } or INV{ MERGEFIELD DocNumber \#"0000" }
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
#13
|
|||
|
|||
HI, I been continued to try all method suggested, however not getting what i desired.
Thanks. |
#14
|
||||
|
||||
If so, one wonders whether you're actually doing a mailmerge.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
Tags |
merge field, merge fields |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Formula to populate column with text prefix then next number (ascending) | SerenityNetworks | Excel | 4 | 02-05-2019 07:22 AM |
Replace characters in mergefield | tommatwalker | Mail Merge | 6 | 07-17-2018 12:30 AM |
Find entries lacking prefix and then add prefix. | gsteel | Excel | 2 | 08-28-2017 11:36 AM |
Word 2007 TOC Section Number w/Alpha Prefix? | Gwen Butler | Office | 2 | 09-29-2011 06:10 AM |
Find & Replace words with "/" prefix & suffix | tollanarama | Word | 4 | 01-25-2011 02:19 AM |