Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #18  
Old 05-30-2018, 04:16 AM
slaycock slaycock is offline SENDKEYS with vbYesNoCancel and Select Case Windows 7 64bit SENDKEYS with vbYesNoCancel and Select Case Office 2016
Expert
 
Join Date: Sep 2013
Posts: 255
slaycock is on a distinguished road
Default

Quote:

Adjusted as suggested but it's still attempting to print the entire document rather than the inputted page range.

One other issue is that it isn't updating the linked data
Try adding the ranges option to the printout statement. The help for the printout statement isn't entirely clear as both the pages and range option are 'optional'. It doesn't state that ranges must be set if pages is used but its worth a try.

If fields are not updating at print then something is odd. We can try to rectify this by updating fields in the document before printing each copy as in your original code.

Replace the print loop with the following and let us know how you get on.

Code:
    For copy_number = first_copy To last_copy
        With ActiveDocument
            .CustomDocumentProperties(cdp_name) = CStr(copy_number)
            .Fields.Update
            .PrintOut copies:=1, Range:=wdPrintRangeOfPages, pages:=my_form.txtPages.Value
        End With
    Next
I checked this by printing to pdf on on my pc and all works as expected. It may not work for you if your field is in a header or footer.
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with Case and Select case brent chadwick Word VBA 34 10-18-2015 02:13 PM
Replace & case Jennifer Murphy Word 1 02-11-2013 03:26 AM
SENDKEYS with vbYesNoCancel and Select Case A macro that can insert FILENAME, sendkeys CTRL ALT T, paste clipboard, and nextline kyjac85 Word VBA 13 09-20-2012 05:00 PM
Problem with the sendkeys in Win7 vidyapakki Excel Programming 1 05-07-2012 11:10 PM
SENDKEYS with vbYesNoCancel and Select Case From all UPPER CASE to Proper Case davers Word 1 04-30-2009 12:41 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:25 AM.


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