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

    how do you add custom code to words native icons (Word97 sr2a)

    Hiya - how do you add custom code to words native icons.
    I need to add our custom code to words print icon located on the standard toolbar
    so the result is
    when user clicks on the print icon - our print code is run.
    any ideas? many thanks Diana

  2. #2
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts

    Re: how do you add custom code to words native icons (Word97 sr2a)

    The easiest way is to drag a button that runs your code onto the toolbar right next to the standard print button. Then right click the standard print button and copy the button image. Now right click the new button and paste the image. Now delete the standard print button by dragging it off the toolbar.
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  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: how do you add custom code to words native icons (Word97 sr2a)

    If you are distributing a global template, you can create procedures with the same names as Word's two print commands, FilePrint and FilePrintDefault (the latter is the one that runs without a dialog). These will override the built-in commands when the user chooses either command from the toolbar or File menu.

  4. #4
    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: how do you add custom code to words native icons (Word97 sr2a)

    I don't know about Word 97, but in Word 2000, customized toolbars from one template can get "merged" with toolbars from another template, resulting in two identical-looking buttons with different functions. I think there was a thread recently on this. If IT has good control of the environment, this likely is a fixable problem, but could be more complex than it initially seems.

  5. #5
    5 Star Lounger
    Join Date
    May 2001
    Location
    Stuttgart, Baden-W, Germany
    Posts
    931
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: how do you add custom code to words native icons (Word97 sr2a)

    > you can create procedures with the same names as Word's two print commands

    There is a new (March 2002) article in the MSDN library describing that method.

    <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>Klaus

Posting Permissions

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