Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 01-30-2012, 03:35 AM
the_adam the_adam is offline merging whole documents? Windows XP merging whole documents? Office 2007
Novice
merging whole documents?
 
Join Date: Jan 2012
Posts: 3
the_adam is on a distinguished road
Default merging whole documents?

Hi all,



I don't have much experience of mail merges but wondered if I might be able to use it to solve a problem,

I work in a school, there are 2 sections to our reports, each one A4 page, that need printing back-to-back. One is an XML report from SIMS that opens in Word, the other an Excel graph. Both documents have a number in the filename that is unique to each student, I wondered if it was possible to use this number to add the graph as a second page to the other document? They go out 6 times a year so it's quite time-consuming at the moment

Adam
Reply With Quote
  #2  
Old 02-03-2012, 04:04 PM
macropod's Avatar
macropod macropod is offline merging whole documents? Windows 7 64bit merging whole documents? Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
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

Hi Adam,

It would probably be possible to use a Word macro(vba) to add the graph to the document, either at print time (perhaps without even saving the changed document), or at some earlier time. Before commenting further, though, I'd need to know whether there's anything in the Word document that can be used to identify the relevant Excel file, whether the Word and Excel files are stored in the same folders or if there's at least a pattern to identifying the path to the folder(s) in which the Excel files are stored, how the Excel files are structured (eg is the graph on the same page as the data, or on a separate sheet).
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 02-06-2012, 02:10 AM
the_adam the_adam is offline merging whole documents? Windows XP merging whole documents? Office 2007
Novice
merging whole documents?
 
Join Date: Jan 2012
Posts: 3
the_adam is on a distinguished road
Default

Thanks for the reply Paul,

The Excel file has the graph as the first sheet, with the data that it comes from on the second. There are a couple of text boxes and lines placed over the top of the graph but it would probably be ok without them, I could alter the template to remove them if necessary.

There's something that could probably be used to identify the Excel files in cell A1 of the data sheet, it's a constant [surname] [forename] [admission number]. Nothing in the report to match it at the moment but I could easily set it up to have the same thing on the first line and use white text to hide it.

Currently the Excel and Word documents are kept in completely different locations but that's open to be changed if it makes things easier - the next set of reports aren't due for a couple of weeks so I can just set it to create both documents in the same folder when that comes round.

Unfortunately I don't have much experience with macros/vba beyond using other peoples' code and trying to work out what it's doing (that's why I was hoping a mail merge could do it!), guess 2 weeks gives me some time to look at it though
Reply With Quote
  #4  
Old 02-06-2012, 02:45 AM
macropod's Avatar
macropod macropod is offline merging whole documents? Windows 7 64bit merging whole documents? Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
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

Hi Adam,

Mailmerge wont work for the following reasons:
• A mailmerge can only accept one worksheet as a data source
• To link to a chart, you'd need to embed a MERGEFIELD inside a LINK field. Unfortunately, as soon as you do that and update the LINK field, it's contents get resolved to text - and the MERGEFIELD gets deleted.
• The fact you have both charts and data in the workbook suggests there's one workbook per student. Mailmerges are designed to work with situations where all the student records are in the same workbook.

Assuming the last point above is correct, then provided your workbook's worksheet and chartsheet names are consistent, a macro can interrogate each of them easily enough without anything to match within each of them. If all the Excel workbooks are in a common folder, a macro could easily enough loop through all files in the folder to produce a report for every student in one go - and save the reports to whatever location you want.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #5  
Old 02-07-2012, 08:09 AM
the_adam the_adam is offline merging whole documents? Windows XP merging whole documents? Office 2007
Novice
merging whole documents?
 
Join Date: Jan 2012
Posts: 3
the_adam is on a distinguished road
Default

Yes, there is one workbook per student, I'll have a look at using a macro. The chartsheet always has the same name so that sounds like a good way to go, you do get the occasional student with the graph document missing but it's not difficult to check for that before running it Thanks for the help
Reply With Quote
  #6  
Old 02-07-2012, 03:29 PM
macropod's Avatar
macropod macropod is offline merging whole documents? Windows 7 64bit merging whole documents? Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
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 the_adam View Post
you do get the occasional student with the graph document missing but it's not difficult to check for that before running it
You could, of course, let the macro do that check and either skip the report or output it without the chart.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Merging Projects C_Howard Project 2 03-29-2012 02:00 PM
Merging or Cut and Paste AnnieM Word 1 06-24-2010 03:03 AM
Help with merging? yazakib Mail Merge 0 04-11-2010 01:24 PM
Merging documents Stattovic Word 7 01-31-2010 03:06 AM
2007 merging multiple documents into one master hugheso Word 0 04-02-2009 04:31 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:31 AM.


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