Consulting

Results 1 to 2 of 2

Thread: Solved: Print Preview - Detect

  1. #1
    VBAX Tutor Philcjr's Avatar
    Joined
    Jul 2005
    Location
    Bedminster, NJ
    Posts
    208
    Location

    Solved: Print Preview - Detect

    Is there a way to detect when a user goes into PrintPreview?

    I have some code in the "Workbook_BeforePrint" sub and I want to jump over it. Specifically, I want to jump over:

    Application.Dialogs(xlDialogPrint).Show Arg12:=2

    Any ideas?

  2. #2
    VBAX Tutor Philcjr's Avatar
    Joined
    Jul 2005
    Location
    Bedminster, NJ
    Posts
    208
    Location
    Does anyone have any suggestions??

    After many hours of searching and searching I have found that it is not possible to detect whether or not "Print" or "PrintPreview" tiggeres the "Workbook_BeforePrint".

    Short of disabling the Print Preview... any other ways to approach this?
    [vba]
    'Turn off Print Preview from Standard Toolbar
    Dim CBControl As Office.CommandBarControl

    For Each CBControl In Application.CommandBars.FindControls(ID:=109)
    CBControl.Enabled = False
    Next CBControl
    [/vba]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •