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

    a few queries re coding in powerpoint (powerpoint97sr2)

    Hi - a couple of questions....
    I'm starting to program in powerpoint.

    when I step thru my code it works.
    However when I run the code it doesnt work?
    any ideas - would you like me send you my code?

    also
    I have created a new toolbar & button that my code is behind.

    when my powerpoint template is opened & I have a presentation open>I click on the button the code is run.
    however when I close my template & on the open presentation > click on the button the code isnt run.
    My code is Public sub.
    any ideas? Diana

  2. #2
    Silver Lounger
    Join Date
    Mar 2001
    Location
    Springfield, Ohio, USA
    Posts
    2,136
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: a few queries re coding in powerpoint (powerpoint97sr2)

    If your code is short (<100 lines) then, just post it as a reply. Please put <!t>[pre]<!/t> before the code and <!t>[/pre]<!/t> after the code so that it retains the indents. Also tell us what the code should do.

    If your code is long, then zip the ppt file and attach it to a reply. Unfortunately, you cannot attach a ppt file directly. Thanks! --Sam
    <font face="Comic Sans MS">Sam Barrett, CACI </font face=comic>
    <small>And the things that you have heard... commit these to faithful men who will be able to teach others also. 2 Timothy 2:2</small>

  3. #3
    Gold Lounger
    Join Date
    Dec 2000
    Location
    New Hampshire, USA
    Posts
    3,386
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: a few queries re coding in powerpoint (powerpoint97sr2)

    What error messages are you getting?

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

    Re: a few queries re coding in powerpoint (powerpoint97sr2)

    Hiya - please find code below....

    This is what is supposed to happen:
    I have 2 powerpoint templates.
    1 - Corrs.pot is the template used for presentations
    this has more colour & graphics.
    Users will be using this template to create presentations.

    The 2nd template - Corrs Print.pot - is -nearly the same design - but with less graphics ie the background is white- just the company banner displayed in colour.

    When the users have 1st template open
    & they would like to print
    before they print - the 2nd template is applied (less graphics etc therefore uses less toner etc on the colour printer.
    when the presentation is printed out - then the orginial template with colour background is applied again.

    1. the code only works when I step thru note: my code is stored in template Corrs.pot
    2. I want to create a custom toolbar with a button that runs my code - however this button only works when I have my template with the code in it open
    3. also I dont know how to indent my code when I post to the lounge

    regards Diana


    Option Explicit

    Public Sub Main()
    Application.ActivePresentation.ApplyTemplate FileName:="C:Program FilesMicrosoft OfficeTemplatescorrsCorrs Print.pot"
    CommandBars("File").Controls("Print...").Execute
    Call Restore
    End Sub

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

  5. #5
    Super Moderator
    Join Date
    Dec 2000
    Location
    New York, NY
    Posts
    2,970
    Thanks
    3
    Thanked 29 Times in 27 Posts

    Re: a few queries re coding in powerpoint (powerpoint97sr2)

    Diana,

    It sounds like you need to keep the code in a PowerPoint add-in (.ppa) rather than a PowerPoint template.
    Not sure if this is done exactly the same way in 97 as in 2000, but you can find information relating to PowerPoint add-ins for 2000 on the MSDN site here.

    To keep the indentation when posting code here, put a [ pre ] tag before it and a [ /pre ] tag (minus the spaces) after it.

    Gary

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

    Re: a few queries re coding in powerpoint (powerpoint97sr2)

    HIya
    I've used the following command to display the
    print dialog box....

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

    is there a way to return or determine/test which button the users have pressed eg OK or Cancel button
    regards 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: a few queries re coding in powerpoint (powerpoint97sr2)

    I don't think you can retrieve any information about the user's interaction with a dialog when you use the Execute method on a control. On the other hand, doesn't PowerPoint update a property with the "time last printed"? You could try to check that.

Posting Permissions

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