#16
|
||||
|
||||
Copy the attached document to the folder containing your base documents, then follow the instructions in the document.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#17
|
|||
|
|||
Quote:
It was because I created the macro DOC in the root directory (which has 12 folders but no files). The files are all in the sub folders, so I was just moving the files from 1-2 of the folders into the root directory for testing purposes. I realise that I should have just put the macro into one of the folders. Thank you. I will test this on Monday. I did have the macro working but am not sure how to explain to you what I mean by the linking of the files that aren't working. |
#18
|
|||
|
|||
Hi Paul,
I've just arrived back in the office and gave this a test. I believe it's working perfectly. There were a few errors with some files being open and some field issues but the macro itself seems to have updated every file required. I'm going to do a little bit more testing and will come back again but it looks the goods! I got through some of the issues I was having (locked files, etc, which I found answers for from yourself on Google from 2012, thanks). My next question is going to be if it's possible to add in a print option to the macro when it runs for each file? I tried the print function from Windows Explorer but it's chopping all sorts of margins off and is quite sloppy compared to the build in print function from Word). We will remove the files we don't need before running the macro and that way everything will print out correctly as required. Could you please let me know if this is possible? Thank you. |
#19
|
||||
|
||||
Surely it would be better to run the merge macro - without messing around with any of the source files beforehand - then delete any of the unwanted output files before running a separate macro to do the printing??
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#20
|
|||
|
|||
I'm all for whichever way is easier. There are no issues with mail merging the unwanted files and having them save, but there are issues with printing the unwanted files, so whether it's one or two macros I don't think it would make much difference. Thank you.
|
#21
|
||||
|
||||
Try the attached. As coded, you should be able to print any project's Word documents at any time - not only immediately after they've been generated.
I imagine that, initially at least, existing projects won't have a 'ProjectDataFile.xlsx' workbook. No matter: simply select whatever the corresponding folder would be for that project.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#22
|
|||
|
|||
Hi Paul,
That is extremely useful. Thank you. I saved the file, put it in a folder and ran the print test on a subfolder with 4 files, just to test it out without printing an entire job. It only printed 1 of the 4 files, and not the first one alphabetically either. What should I be looking for to troubleshoot the problem? Thank you. |
#23
|
||||
|
||||
The code works fine in my testing - all Word documents in both the chosen folder and its subfolders are processed (printed). Are you sure they're not stuck in your printer queue?
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#24
|
|||
|
|||
I'm not quite sure to be honest. Should the macro work without any mail merge involved? I created a new folder with 4 x .txt files in it, tested, and didn't work. Nothing in the print queue, etc. I've tested a few different ways and can't seem to get it to work properly.
|
#25
|
||||
|
||||
The macro is for processing Word documents, not .txt files! It really doesn't matter how those documents were generated, however.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#26
|
|||
|
|||
So in the situation where we have a mixture of DOCX files that we're using for Mail Merge, and PDF files that are already complete, the macro won't be able to print those out as the macro is being run from inside Word?
With that said, the folder that I'm testing on is a MISC folder. There are 4 files, none of them involve the mail merge. One is a PDF, one is a DOC, two are DOCX. Only the DOC file is printing with the print macro. |
#27
|
||||
|
||||
The macro prints Word documents - be they in the doc, docx, or docm formats. I'd have though that was obvious from both the heading (Project Document Print Instructions) and the 'print all of the project documents for that project' reference under the MACROBUTTON field - itself titled 'Print Project Documents'. I'd have also thought that was the clearly understood intention from all we'd discussed up to that point. Even if I'd implemented things along the way you initially described (post #20), all that would have been printed is the mailmerge output documents.
I don't know why you're raising the issue of .txt and .pdf files now, when all the prior discussion has been about Word documents; we never discussed printing anything else and I never suggested the macro could do more.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Summarise information from multiple worksheets in multiple files | alistair_ | Excel Programming | 5 | 04-10-2017 08:27 AM |
Printing multiple envelopes in Word 2007 | terrydennis | Word | 4 | 11-11-2015 05:04 PM |
convert multiple csv files to multiple excel files | mit | Excel | 1 | 06-14-2011 10:15 AM |
Printing multiple page worksheet with watermark | zany | Excel | 2 | 11-27-2009 01:33 AM |
Outlook XP (2002) printing multiple attachments | couriced | Outlook | 0 | 10-13-2005 05:36 AM |