Vba Word Printout Exampes
Create a Print Button with VBA. Click the “Developer” tab on the ribbon. Click the “Insert” icon drop-down arrow in the 'Controls' section of the 'Developer' tab. Click the “Button Control” icon under 'Form Controls.' Click the cell in the spreadsheet where you want to place a print button. Tutorial - Save Pages as Separate PDFs. The VBA code issues 3 prompts: 1. Enter the directory where you want to save your PDFs. Enter the page number in your Word document where you want to begin saving individual pages as PDFs. Enter the page number in your Word document where you want to stop saving individual pages as PDFs.
Set the Background property of the PrintOut Method to False to prevent the next command from being executed until the printing is complete.- Hope this helps.Doug Robbins - Word MVP,dkratsymbolmvpsdotorgPosted via the Community Bridge'ddunn10' wrote in message news:20b8e17f-7fec-4988-a4a8-2ae4e9829535@communitybridge.codeplex.com. Thanks for your reply, I managed to get it to work using a different pdf converter called PDF Creator (which allows you to specify a location in the options so it prints there automatically)The next bit I am stuck on is the way the code runs, I want to use the saved pdf file to attach it to an email. But the problem is that the printing of the pdf doesn't start until the end of the sub.Sub SubName Application.PrintOut'Code for attaching the saved file to an emailEnd SubI've tried using sleep after Application.PrintOut to wait until the file is printed, but this doesn't work, it just seems to wait until the end of the sub until it does the printing!Is there a way to wait until the pdf is printed until my second part of my code is run?Thanks for any adviceDoug Robbins - Word MVP dkratsymbolmvpsdotorg.
Vba Word Printout Exampes Examples
Probably not - unless CutePDF is programmable, and freebies are usually not.If you have have Word 2007/10 or Acrobat you can achieve this. Wrote in message news:263fcc3d-9e34-463a-a846-c4f277022091@communitybridge.codeplex.com.Hi, I am using the follwing code to to print a Word doc to a pdf file, using VBA and a free pdf converter.Application.ActivePrinter = 'CutePDF Writer'Application.PrintOutAfter running this code it prompts for a file and path name. Is there any way I can use VBA to automatically enter the file and path name?Many ThanksGraham Mayor - Word MVPPosted via the Communities Bridge.
Thanks for your reply, I managed to get it to work using a different pdf converter called PDF Creator (which allows you to specify a location in the options so it prints there automatically)The next bit I am stuck on is the way the code runs, I want to use the saved pdf file to attach it to an email. But the problem is that the printing of the pdf doesn't start until the end of the sub.Sub SubNameApplication.PrintOut'Code for attaching the saved file to an emailEnd SubI've tried using sleep after Application.PrintOut to wait until the file is printed, but this doesn't work, it just seems to wait until the end of the sub until it does the printing!Is there a way to wait until the pdf is printed until my second part of my code is run?Thanks for any advice.
Set the Background property of the PrintOut Method to False to prevent the next command from being executed until the printing is complete.- Hope this helps.Doug Robbins - Word MVP,dkratsymbolmvpsdotorgPosted via the Community Bridge'ddunn10' wrote in message news:20b8e17f-7fec-4988-a4a8-2ae4e9829535@communitybridge.codeplex.com. Thanks for your reply, I managed to get it to work using a different pdf converter called PDF Creator (which allows you to specify a location in the options so it prints there automatically)The next bit I am stuck on is the way the code runs, I want to use the saved pdf file to attach it to an email. But the problem is that the printing of the pdf doesn't start until the end of the sub.Sub SubName Application.PrintOut'Code for attaching the saved file to an emailEnd SubI've tried using sleep after Application.PrintOut to wait until the file is printed, but this doesn't work, it just seems to wait until the end of the sub until it does the printing!Is there a way to wait until the pdf is printed until my second part of my code is run?Thanks for any adviceDoug Robbins - Word MVP dkratsymbolmvpsdotorg.