Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 03-13-2019, 02:10 AM
retro retro is offline Word mail merge with unique charts Windows 10 Word mail merge with unique charts Office 2016
Novice
Word mail merge with unique charts
 
Join Date: Mar 2019
Posts: 4
retro is on a distinguished road
Default Word mail merge with unique charts

Hi there,
I'm trying to create a mail merge where each document contains a bar graph based off a value, seems a really simple task but I don't think its achievable.

I did find one helpful post (https://www.msofficeforums.com/mail-...cel-graph.html) where user macropod briefly explained to use field codes, the demo works but information is lacking online.

I currently generate these letters using a PHP script outputing them as PDF files but it would make life so much easier if i could convert this as a mail merge, the only thing stopping me is the chart.



My current chart setup is based on
"Name"
"Number of Minutes Lost"

Some students have values of 15 minutes lost, 189 minutes lost all the way up to 3989 minutes lost



The green bar is average for the year

Any advice would be greatly apreciated!

Last edited by retro; 03-13-2019 at 03:05 AM. Reason: image example upload
Reply With Quote
  #2  
Old 03-13-2019, 03:08 AM
macropod's Avatar
macropod macropod is offline Word mail merge with unique charts Windows 7 64bit Word mail merge with unique charts Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
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

Did you try implementing the example in the Demo document in the link?
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 03-13-2019, 03:12 AM
retro retro is offline Word mail merge with unique charts Windows 10 Word mail merge with unique charts Office 2016
Novice
Word mail merge with unique charts
 
Join Date: Mar 2019
Posts: 4
retro is on a distinguished road
Default

Thanks for the reply,
I did and it works great, struggled with implementing it to fit the 21 conditions i have though, edited your example to accommodate numbers above 100 (as im not dealing with percentages) but this can be unmanageable when dealing with numbers that run into the thousands, which is why i need some if statements
eg if val < 10 then only draw graph up to the less than 10 mark, if val > 200 then draw the full chart
Reply With Quote
  #4  
Old 03-13-2019, 03:22 AM
macropod's Avatar
macropod macropod is offline Word mail merge with unique charts Windows 7 64bit Word mail merge with unique charts Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
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

For the most part, all you should need to do is copy & paste the example from that document as-is, rather than trying to reconstruct the entire field yourself.

As for the output, maybe you should consider using logarithmic values for the output. That way the re-scaling is both progressive and automatic. To see how to do that in Word, check out the Logarithms topic in my Microsoft Word Field Maths Tutorial: https://www.msofficeforums.com/word/...-tutorial.html. Otherwise, all you need to add is a single IF test that divides the merged value by a given constant if it exceeds 10.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #5  
Old 03-13-2019, 05:46 AM
gmayor's Avatar
gmayor gmayor is offline Word mail merge with unique charts Windows 10 Word mail merge with unique charts Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,101
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

Quote:
Originally Posted by retro View Post
Any advice would be greatly apreciated!
Maybe https://www.gmayor.com/mail_merge_charts.htm would help?
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
  #6  
Old 03-13-2019, 07:00 AM
retro retro is offline Word mail merge with unique charts Windows 10 Word mail merge with unique charts Office 2016
Novice
Word mail merge with unique charts
 
Join Date: Mar 2019
Posts: 4
retro is on a distinguished road
Default

Thankyou for the reply ...

I have managed to do it another way as i needed it to look as close to the chart as possible, I have now amended my mail merge data with a new column and a nested if statement in excel puts the file paths in matching the conditions i have set,

I then used macropod's example of field code to include a picture in the word mail merge.

{ include picture {if true"{MERGEFILED pupil_mins_lost_imagepath}" \d }

This works as intended!

Thankyou both for your help
Reply With Quote
  #7  
Old 09-11-2019, 07:59 AM
anel1223 anel1223 is offline Word mail merge with unique charts Mac OS X Word mail merge with unique charts Office 2016 for Mac
Novice
 
Join Date: Sep 2019
Posts: 1
anel1223 is on a distinguished road
Default

Retro,


were you able to figure out this mail merge? I have the similar issue with students that I am trying to mail merge letters with a chart for each student.
Reply With Quote
  #8  
Old 09-11-2019, 08:27 AM
retro retro is offline Word mail merge with unique charts Windows 10 Word mail merge with unique charts Office 2016
Novice
Word mail merge with unique charts
 
Join Date: Mar 2019
Posts: 4
retro is on a distinguished road
Default

I did....
It was hard work though, how far have you got with your mail merge fields?

if you press alt+F9 you will see the merge field code
i then added my merge field source spreadsheet with filepaths to my images needed and used this

{ include picture {if true"{MERGEFILED pupil_mins_lost_imagepath}" \d }

press alt+F9 and preview the results and your image should appear if it exists in the image path in your mail merge source
Reply With Quote
  #9  
Old 09-11-2019, 02:56 PM
macropod's Avatar
macropod macropod is offline Word mail merge with unique charts Windows 7 64bit Word mail merge with unique charts Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
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

The Demo document attached to https://www.msofficeforums.com/73816-post2.html shows how to implement a simple bar chart. All you'd need to do is to copy the field coding into your own document and change the mergefield's source name to suit your data. As presented, the coding charts percentages up to 100. They don't have to be percentages, though, and the logic is easily extended to include hundreds and thousands but, once you start getting into that, a logarithmic scale might be more useful.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply

Tags
charts, mail merge

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Word mail merge with unique charts Mail Merge List of Items for Unique OwnerIDs HunterH Mail Merge 1 10-12-2018 02:03 PM
Word mail merge with unique charts Unique data per record in mail merge chart aplarsen Word VBA 2 02-16-2018 04:01 PM
Word mail merge with unique charts Activating Unique Links in Email Messages Using a Mail Merge User02182016 Mail Merge 1 02-23-2016 06:02 PM
Word mail merge with unique charts Mail Merge URL - a unique question kitefrantic Mail Merge 1 12-31-2013 07:34 PM
dynamic charts based on mail merge fields jwajehee Mail Merge 0 10-05-2011 09:47 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:00 PM.


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