VBA to change Display for Review setting

M

megnotarte

Hello, I need to be able to change the Display for Review setting from
"Final" to "Final Showing Markup", but I can't seem to find the correct code
to do so. Can anyone help with this?
 
J

Jay Freedman

Hello, I need to be able to change the Display for Review setting from
"Final" to "Final Showing Markup", but I can't seem to find the correct code
to do so. Can anyone help with this?

In terms of VBA, the "Final Showing Markup" consists of two separate properties:

With ActiveWindow.View
.RevisionsView = wdRevisionsViewFinal
.ShowRevisionsAndComments = True
End With

If you're sure the view is already Final, you can omit the first of these two,
but it's safer to leave nothing to chance.
 
M

megnotarte

Hi Jay,
Thanks for the quick response. Here's the rub...I have been trying that, but
it's not working. Basically I want it to go into "Final Showing Markup" on
print of the document, but it appears that it isn't taking effect until after
the print command is issued. Here's the code I'm using

Private Sub appWord_DocumentBeforePrint(ByVal doc As Document, Cancel As
Boolean)
With ActiveWindow.View
.RevisionsView = wdRevisionsViewFinal
.ShowRevisionsAndComments = True
End With


End Sub

I've tried using other function calls in that DocumentBeforePrint function,
but it seems like they get stalled once the print dialog box shows up. After
the dialog box is cleared (either by printing or canceling the print) it
finishes up. Any idea what's going on?

Thanks again for you help!
Megan
 
J

Jay Freedman

Hi Jay,
Thanks for the quick response. Here's the rub...I have been trying that, but
it's not working. Basically I want it to go into "Final Showing Markup" on
print of the document, but it appears that it isn't taking effect until after
the print command is issued. Here's the code I'm using

Private Sub appWord_DocumentBeforePrint(ByVal doc As Document, Cancel As
Boolean)
With ActiveWindow.View
.RevisionsView = wdRevisionsViewFinal
.ShowRevisionsAndComments = True
End With


End Sub

I've tried using other function calls in that DocumentBeforePrint function,
but it seems like they get stalled once the print dialog box shows up. After
the dialog box is cleared (either by printing or canceling the print) it
finishes up. Any idea what's going on?

Thanks again for you help!
Megan

Sorry, I don't have any idea what's going on, because I've never played with
that event function. I prefer to do things "the old-fashioned way" because I
know it works:

Sub FilePrint()
With ActiveWindow.View
.RevisionsView = wdRevisionsViewFinal
.ShowRevisionsAndComments = True
End With
Dialogs(wdDialogFilePrint).Show
End Sub

Sub FilePrintDefault()
With ActiveWindow.View
.RevisionsView = wdRevisionsViewFinal
.ShowRevisionsAndComments = True
End With
ActiveDocument.PrintOut
End Sub
 
M

megnotarte

Hi Jay,
Will that function be called on print (when the user goes file -> print or
ctrl+p)?

Thanks!
Megan
 
J

Jay Freedman

megnotarte said:
Hi Jay,
Will that function be called on print (when the user goes file ->
print or ctrl+p)?

Thanks!
Megan

There are two functions there. The FilePrint procedure will be called when
the user clicks the File > Print command or presses its shortcut Ctrl+P. The
FilePrintDefault procedure will be called when the user clicks the Print
button on the toolbar (which doesn't display the dialog but just prints the
whole document).

Please read the article I pointed to,
http://www.word.mvps.org/FAQs/MacrosVBA/InterceptSavePrint.htm, to
understand the idea of making macros that intercept built-in commands.

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
M

megnotarte

Ah! Ok - great. I'll give that a shot. I'm not too familiar with the
appWord_DocumentBeforePrint method either...I wonder how it differs from the
FilePrint and FilePrintDefault procedures.

Thanks a lot for your help!

Megan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top