Microsoft Office Forums

Go Back   Microsoft Office Forums > Microsoft Word > Word VBA

Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 08-08-2012, 02:14 PM
Stanza_chad Stanza_chad is offline Windows 7 64bit Office 2010 64bit
Novice
 
Join Date: Aug 2012
Posts: 3
Stanza_chad is on a distinguished road
Default Print Document (no markups)

Trying to create a macro to be able print documents without showing markup comments. Apparently it is not possible to uncheck Print Markups by default if there open comments, so hoping to work around that by creating a shortcut.


So far I have this, but doesn't seem to change the Print what option to just say Document:
Code:
Sub PrintDoc()
'
' Print document only, no markups.
'
Application.PrintOut Range:=wdPrintAllDocument, Item:= _
wdPrintDocumentContent, Copies:=1
End Sub
Any suggestions would be great at this point.

Thanks.

Last edited by macropod; 08-08-2012 at 05:12 PM. Reason: Added code tags
Reply With Quote
  #2  
Old 08-08-2012, 07:04 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 16,300
macropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to behold
Default

Hi Stanza_chad,

Your macro should simply print the document without invoking the Print dialogue. It also has no effect on that dialogue.

Ordinarily, if you print a document containing comments, you'll get a warning. The following modifications will suppress that warning:
Code:
Sub PrintDoc()
Dim bOption As Boolean
bOption = Options.WarnBeforeSavingPrintingSendingMarkup
Options.WarnBeforeSavingPrintingSendingMarkup = False
Application.PrintOut Range:=wdPrintAllDocument, _
  Item:=wdPrintDocumentContent, Copies:=1
Options.WarnBeforeSavingPrintingSendingMarkup = bOption
End Sub
__________________
Cheers,
Paul Edstein
[MS MVP - Word]
Reply With Quote
  #3  
Old 08-09-2012, 09:09 AM
Stanza_chad Stanza_chad is offline Windows 7 64bit Office 2010 64bit
Novice
 
Join Date: Aug 2012
Posts: 3
Stanza_chad is on a distinguished road
Default Re:

Nope, that code doesn't do anything different. Print screen still pops up with Documents showing markup as the default option. See screen shot attached.
When going through File > Print > Settings, Print Markup is selected that route as well.
Attached Images
File Type: png Print Document.png (29.7 KB, 5 views)
Reply With Quote
  #4  
Old 08-09-2012, 04:30 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 16,300
macropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to behold
Default

Hi Stanza_chad,

As I said in my previous post:
Quote:
Your macro should simply print the document without invoking the Print dialogue. It also has no effect on that dialogue.
Please re-read the last sentence especially. What you're displaying in your last post is the Print dialogue. If you run your macro, the output should go direct to the printer without displaying the print dialogue. If you want to modify the print dialogue, you will need entirely different code.
__________________
Cheers,
Paul Edstein
[MS MVP - Word]
Reply With Quote
  #5  
Old 08-09-2012, 07:48 PM
Stanza_chad Stanza_chad is offline Windows 7 64bit Office 2010 64bit
Novice
 
Join Date: Aug 2012
Posts: 3
Stanza_chad is on a distinguished road
Default Re:

An existing add-on calls the Print Dialogue whenever I print anything. Don't ask me why... Whether I use the QuickPrint option or go to File > Print, the Print Dialague window displays and I can't seem to change that without uninstalling necessary add-ons. Different code that will modify the print dialague is exactly what I'm looking for!
Reply With Quote
  #6  
Old 08-09-2012, 08:44 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 16,300
macropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to behold
Default

Quote:
Originally Posted by Stanza_chad View Post
An existing add-on calls the Print Dialogue whenever I print anything.
Do you mean to say that the Print Dialogue displays even when you run your PrintDoc macro? If so, nothing short of disabling your addin is likely to work. That said, you could try something like:
Code:
Sub Test()
Dim bOption As Boolean, bAddin As Boolean
With Application
  bAddin = .AddIns("Name").Installed
  bOption = .Options.WarnBeforeSavingPrintingSendingMarkup
  .AddIns("Name").Installed = False
  .Options.WarnBeforeSavingPrintingSendingMarkup = False
  With .Dialogs(wdDialogFilePrint)
    SendKeys "%W^{HOME}{ENTER}"
    .Show
  End With
  .Options.WarnBeforeSavingPrintingSendingMarkup = bOption
  .AddIns("Name").Installed = bAddin
End With
End Sub
Note: Where you see '.AddIns("Name")', you'll need to supply your addin's name.
__________________
Cheers,
Paul Edstein
[MS MVP - Word]
Reply With Quote
Reply
Please reply to this thread with any new information or opinions.

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Print document except first page nkg Word VBA 5 05-05-2012 03:57 AM
Mutliple copies 167 print as one document John-N Mail Merge 5 02-19-2012 07:15 PM
Save and send markups ceocast Word 1 12-09-2010 10:39 AM
How can I print out the document as follow? turbomen Project 1 05-23-2010 07:24 AM
When I print the document changes layout cooney Word 0 03-01-2010 12:17 AM


All times are GMT -7. The time now is 07:01 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
MSOfficeForums.com is not affiliated with Microsoft