Results 1 to 8 of 8
  1. #1
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Melbourne, Australia
    Posts
    1,294
    Thanks
    0
    Thanked 0 Times in 0 Posts

    syntax to call & display Print dlg in powerpoint (powerpoint sr2)

    Hi
    Does anyone know the VBA code /syntax to
    call & display the print dialog box in Powerpoint.
    tia Diana

  2. #2
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Melbourne, Australia
    Posts
    1,294
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: syntax to call & display Print dlg in powerpoint (powerpoint sr2)

    thankyou - worked a treat! Diana

  3. #3
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: syntax to call & display Print dlg in powerpoint (powerpoint sr2)

    Not elegant, but you can run almost any menu command this way:

    CommandBars("File").Controls("Print...").Execute

    Note that if the menu has been customized, and, as a result, there is no matching command, you will get a runtime error.

  4. #4
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Melbourne, Australia
    Posts
    1,294
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: syntax to call & display Print dlg in powerpoint (powerpoint sr2)

    hi - I now have another problem....
    below is my code....
    It appears to ignore any commands after the print command? Any ideas? All I am trying to do is apply a new Style, print and reapply original style.


    Option Explicit
    Sub Print_Format()
    ActivePresentation.ApplyTemplate FileName:="C:Program FilesMicrosoft OfficeTemplatescorrsCorrs Print.pot"
    CommandBars("File").Controls("Print...").Execute
    Call Restore
    End Sub

    Sub Restore()
    ActivePresentation.ApplyTemplate FileName:="C:Program FilesMicrosoft OfficeTemplatescorrsCorrs.pot"
    End Sub

  5. #5
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: syntax to call & display Print dlg in powerpoint (powerpoint sr2)

    It doesn't wait; you can see this if you put <font color=blue>MsgBox "I've gone beyond"</font color=blue> on the line after the .Execute.

    Probably need to use a different technique, or use that nasty, messy, not very reliable code that watches for a window to exist and then watches for it to disappear...if that even works with a dialog.

    Or perhaps <font color=blue>MsgBox "After printing, press OK to continue"</font color=blue> is the workaround, as it lurks behind the print dialog. Rather unsatisfactory from an aesthetic perspective, but I'm going home so it's the best I can do this evening.

  6. #6
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Melbourne, Australia
    Posts
    1,294
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: syntax to call & display Print dlg in powerpoint (powerpoint sr2)

    Hi
    It may be possible to use the 'undo' syntax
    however powerpoint doesnt seem to have or recognise this syntax/command.
    Is writing code in powerpoint very limited in what we can automate?
    Diana

  7. #7
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: syntax to call & display Print dlg in powerpoint (powerpoint sr2)

    > Is writing code in powerpoint very limited in what we can automate?

    So it appears! I actually have not explored where Undo might be in the object model. If you press F2 in the VBE, use the drop-down to select the PowerPoint object library and search for Undo, you might find it. If not, well...

  8. #8
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Melbourne, Australia
    Posts
    1,294
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: syntax to call & display Print dlg in powerpoint (powerpoint sr2)

    jscher - cheers Diana

Posting Permissions

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