Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #4  
Old 12-25-2013, 12:37 AM
macropod's Avatar
macropod macropod is offline Right Justify Values in a Mail Merge Windows 7 32bit Right Justify Values in a Mail Merge Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,514
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Quote:
Originally Posted by hadenp View Post
Re: the justification question- Do I need to insert braces and then use Word's insert tabs dialog to insert the tab stop and tab? What value would I put in the Tab Stop position?
No extra field braces are required. You need only insert the tab stops in the positions where you want the alignment to occur, just as you would in an ordinary document. Don't be concerned with whether they mergefields align correctly, as they're quite possibly going to be wider than the actual data.
Quote:
Re: inserting a Totals line - I just need totals for one group (Amounts) per key. I inserted immediately after the {Set Key) statement in the first line of code. Then, I output Tot1 just after .

Further down, where I output date and amount records, I inserted , which if I understand correctly is where each amount is being summed into Tot1. However, the Total shows as 0. :{

My understanding of the syntax is still rudimentary and I think I must be missing something. Thanks in advance for any suggestions.
For your purposes, you could use the two {SET Tot1 0} fields, the {SET Tot1 {=Tot1+{MERGEFIELD Sales}}} field (all in red), plus the {=Tot1 \# $,0} field (with or without the table, depending on what you're doing table-wise). Note that, because you now have two fields for the true condition in the initial IF test, they need to be wrapped in double-quotes, thus:
{IF{MERGESEQ}= 1 "{SET Key ""}{SET Tot1 0}" {SET LastKey {REF Key}}}
In the attachment, which is based directly on the tutorial, I've implemented the totals for a merge using a single key - using 'Total' instead of 'Tot1'. If you simply connect it to your copy of the tutorial's datasource file, you should be able to generate the merge.
Attached Files
File Type: doc Mailmerge Main Document.doc (33.5 KB, 35 views)
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
 

Tags
field code, justification, tabs

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Loss of formulae values when mail merging excel to word MellowMel Mail Merge 6 05-09-2014 09:08 AM
Prevent Zero Values being Suppressed in a Mail Merge HangMan Mail Merge 2 12-11-2013 02:28 PM
Right Justify Values in a Mail Merge Content control merge values? skrallemand Word VBA 8 10-02-2013 06:54 AM
Mail Merge Duplication of address on merge RICKY Mail Merge 1 09-26-2012 03:14 PM
Right Justify Values in a Mail Merge Conditional merge fields in mail merge Aude Mail Merge 1 01-06-2012 07:38 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 06:11 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft