![]() |
|
|
|
#1
|
||||
|
||||
|
Did you actually attach the data source to the document and complete the merge? It's a bit tortuous but Paul's field codes usually work as intended. This lot is no exception.
Press ALT+F9 to toggle the fields and it shows: {QUOTE{SET Phone {MERGEFIELD LeadBrokerHtcPhone}} {IF{REF Phone}= “?1*” 1 {IF{REF Phone}= “?2*” 2 {IF{REF Phone}= “?3*” 3 {IF{REF Phone}= “?4*” 4 {IF{REF Phone}= “?5*” 5 {IF{REF Phone}= “?6*” 6 {IF{REF Phone}= “?7*” 7 {IF{REF Phone}= “?8*” 8 {IF{REF Phone}= “?9*” 9 0}}}}}}}}} {IF{REF Phone}= “??1*” 1 {IF{REF Phone}= “??2*” 2 {IF{REF Phone}= “??3*” 3 {IF{REF Phone}= “??4*” 4 {IF{REF Phone}= “??5*” 5 {IF{REF Phone}= “??6*” 6 {IF{REF Phone}= “??7*” 7 {IF{REF Phone}= “??8*” 8 {IF{REF Phone}= “??9*” 9 0}}}}}}}}} {IF{REF Phone}= “???1*” 1 {IF{REF Phone}= “???2*” 2 {IF{REF Phone}= “???3*” 3 {IF{REF Phone}= “???4*” 4 {IF{REF Phone}= “???5*” 5 {IF{REF Phone}= “???6*” 6 {IF{REF Phone}= “???7*” 7 {IF{REF Phone}= “???8*” 8 {IF{REF Phone}= “???9*” 9 0}}}}}}}}} {IF{REF Phone}= “?????1*” “.1” {IF{REF Phone}= “?????2*” “.2” {IF{REF Phone}= “?????3*” “.3” {IF{REF Phone}= “?????4*” “.4” {IF{REF Phone}= “?????5*” “.5” {IF{REF Phone}= “?????6*” “.6” {IF{REF Phone}= “?????7*” “.7” {IF{REF Phone}= “?????8*” “.8” {IF{REF Phone}= “?????9*” “.9” “.0”}}}}}}}}} {IF{REF Phone}= “??????1*” 1 {IF{REF Phone}= “??????2*” 2 {IF{REF Phone}= “??????3*” 3 {IF{REF Phone}= “??????4*” 4 {IF{REF Phone}= “??????5*” 5 {IF{REF Phone}= “??????6*” 6 {IF{REF Phone}= “??????7*” 7 {IF{REF Phone}= “??????8*” 8 {IF{REF Phone}= “??????9*” 9 0}}}}}}}}} {IF{REF Phone}= “???????1*” “1.” {IF{REF Phone}= “???????2*” “2.” {IF{REF Phone}= “???????3*” “3.” {IF{REF Phone}= “???????4*” “4.” {IF{REF Phone}= “???????5*” “5.” {IF{REF Phone}= “???????6*” “6.” {IF{REF Phone}= “???????7*” “7.” {IF{REF Phone}= “???????8*” “8.” {IF{REF Phone}= “???????9*” “9.” “0.”}}}}}}}}} {IF{REF Phone}= “*1???” 1 {IF{REF Phone}= “*2???” 2 {IF{REF Phone}= “*3???” 3 {IF{REF Phone}= “*4???” 4 {IF{REF Phone}= “*5???” 5 {IF{REF Phone}= “*6???” 6 {IF{REF Phone}= “*7???” 7 {IF{REF Phone}= “*8???” 8 {IF{REF Phone}= “*9???” 9 0}}}}}}}}} {IF{REF Phone}= “*1??” 1 {IF{REF Phone}= “*2??” 2 {IF{REF Phone}= “*3??” 3 {IF{REF Phone}= “*4??” 4 {IF{REF Phone}= “*5??” 5 {IF{REF Phone}= “*6??” 6 {IF{REF Phone}= “*7??” 7 {IF{REF Phone}= “*8??” 8 {IF{REF Phone}= “*9??” 9 0}}}}}}}}} {IF{REF Phone}= “*1?” 1 {IF{REF Phone}= “*2?” 2 {IF{REF Phone}= “*3?” 3 {IF{REF Phone}= “*4?” 4 {IF{REF Phone}= “*5?” 5 {IF{REF Phone}= “*6?” 6 {IF{REF Phone}= “*7?” 7 {IF{REF Phone}= “*8?” 8 {IF{REF Phone}= “*9?” 9 0}}}}}}}}} {IF{REF Phone}= “*1” 1 {IF{REF Phone}= “*2” 2 {IF{REF Phone}= “*3” 3 {IF{REF Phone}= “*4” 4 {IF{REF Phone}= “*5” 5 {IF{REF Phone}= “*6” 6 {IF{REF Phone}= “*7” 7 {IF{REF Phone}= “*8” 8 {IF{ }= “*9” 9 0}}}}}}}}} } Don't even try to make that into fields without using Import and export field constructions as text. Copy it from the document. Or you could simply add another column to your data sheet with the number as text in the correct format and merge that field instead.
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
|
#2
|
||||
|
||||
|
Quote:
Quote:
![]() Quote:
Quote:
Ultimately, if this code that I'm using SHOULD work, then it's the application that is the issue. I'm thinking it's the {QUOTE} before the rest of the code that's causing the issue, but I wanted to make sure I hadn't made an error somewhere else. Thanks again for your help. |
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Add custom phone number field to Outlook 2013 Contact? | King Mustard | Outlook | 0 | 06-10-2015 08:12 AM |
Extracting a phone number from a string that contains text and numbers.
|
hommi16 | Excel | 2 | 06-05-2013 09:19 PM |
Extract phone number from word file
|
donlincolnmsof | Word VBA | 12 | 06-19-2012 05:21 PM |
Phone number formatting
|
Mark Micallef | Outlook | 1 | 08-04-2010 02:38 PM |
| in WORD, how do i type a 9-digit phone number "xxxxxxxxx" and have it automatically.. | jay8962 | Word | 0 | 04-08-2010 11:08 AM |