Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to format multiline numeric merge fields

Posted on 2009-05-19
8
Medium Priority
?
605 Views
Last Modified: 2012-05-07
Hi there,

I have a field that contains multiple dates on separate lines. When this contains only one date, my merge field works fine with the following...

{MERGEFIELD "TheVals" \#"£0.00"}
which returns £89.75

but if there are more than one value in there, it does something very odd.....

If the merge field contains...
12.99
1.50
2.50

...what it returns is....
£16.99

So the formatting worked, but it totalled everything.

If I have the merge field in there without the formatting formulae, it just returns the values one under the other thus....
12.99
1.50
2.50

Any ideas would be gratefully received!

Cheers,
Matt
0
Comment
Question by:PolymorphLtd
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
8 Comments
 
LVL 46

Expert Comment

by:tbsgadi
ID: 24422371
Hi,
You won't be able to do the formatting in the document.You'll need to add the "£" sign to the data.

Gary
0
 

Author Comment

by:PolymorphLtd
ID: 24422402
Hi there,

Annoyingly, the pound sign is in the data, Word strips it out (and any trailing zeros after the decimal point) which is why I've had to put the formatting formula in.

My datasource is an HTML file containing a table

Cheers,
Matt
0
 

Author Comment

by:PolymorphLtd
ID: 24422737
eg. In the datasource, I've got the following...

<TD>£1000.00<br>£0.00<br>£25.00<br>£333.33<br>£33.33<br>£65.50<br>£120.00<br>£18.52<br>£18.52<br>£18.52</TD>

Word correctly interprets it as a multiline value but then insists on removing the pound signs and the trailing zeros
0
New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

 

Author Comment

by:PolymorphLtd
ID: 24422753
Even more annoying is that Word2007 doesn't remove them but Word2003 does
0
 

Author Comment

by:PolymorphLtd
ID: 26482945
Just as a follow up to this - I think we finally fixed it by putting a space between the pound sign and the number in the data i.e. "£ 1200.00" and Word kept it - without the space, Word stripped it
0
 
LVL 46

Expert Comment

by:tbsgadi
ID: 26482972
It took almost a year but great!
0
 

Accepted Solution

by:
ee_auto earned 0 total points
ID: 32650641
Question PAQ'd, 125 points refunded, and stored in the solution database.
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is written from a 'VBA for MS Word' perspective, but I am sure it applies to most other MS Office components where VBA is used.  One thing that really bugs me is slow code, ESPECIALLY when it's mine!  In programming there are so many ways to…
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
This video teaches the viewer how to align pictures around text while keeping the text properly aligned in the document.
This video shows where to find the word count, how to display it, and what it breaks down to in Microsoft Word.

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question