Results 1 to 5 of 5
  1. #1
    Bronze Lounger
    Join Date
    Jun 2001
    Location
    New York, New York, Lebanon
    Posts
    1,449
    Thanks
    1
    Thanked 1 Time in 1 Post

    Where to place the last Toolbar (Word 97 and >)

    <img src=/S/hello.gif border=0 alt=hello width=25 height=29> Loungers

    Is there an easy way to determine how much space is taken by the MS-Word Toolbars, so that I can dock my toolbar at the end?

    To give you an example, if you are talking about menus, you can always say fetch the position of the Help Menu and place the custom menu to the left or right of this position.

    But with Toolbars, someone may have added his or her own buttons, so they will not be the same length across the screen.

    Does this also rely on screen resolution?

    Thanks for any hint.

    Wassim
    <img src=/S/compute.gif border=0 alt=compute width=40 height=20> in the <img src=/S/bagged.gif border=0 alt=bagged width=22 height=22>

  2. #2
    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: Where to place the last Toolbar (Word 97 and >

    CommandBars have a number of properties that provide hints about their position on the screen. However, as you probably suspected, the CommandBars collection is not organized in visual order, so you will have to loop through all of them to determine which are visible and occupy the "last" row (excluding any docked at the bottom of the window) and how much space they leave relative to the width of the user's display, etc. If you search the lounge for threads on CommandBar position and width, you might find some useful code samples.

  3. #3
    Bronze Lounger
    Join Date
    Jun 2001
    Location
    New York, New York, Lebanon
    Posts
    1,449
    Thanks
    1
    Thanked 1 Time in 1 Post

    Re: Where to place the last Toolbar (Word 97 and >

    <img src=/S/thankyou.gif border=0 alt=thankyou width=40 height=15> Jefferson

    I will post a bit of code in the coming days.

    Here is what I figured out:

    1) You need to find out how many Toolbars are displayed. This you can get by looking at the oToolBar.RowIndex
    2) Then you need to find how wide these Toolbars are and you can use the oToolBar.Width.

    Then you can figure out how many rows of Toolbars do you have displayed and then take the width of the smallest row, and put your ToolBar there.

    Do you think this is too much work?

    Wassim
    <img src=/S/compute.gif border=0 alt=compute width=40 height=20> in the <img src=/S/bagged.gif border=0 alt=bagged width=22 height=22>

  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: Where to place the last Toolbar (Word 97 and >

    > Do you think this is too much work?

    Not for a computer. <img src=/S/laugh.gif border=0 alt=laugh width=15 height=15> I guess it really depends on how important the placement is to you. Personally I get annoyed when an add-in always adds a new row.

  5. #5
    Bronze Lounger
    Join Date
    Jun 2001
    Location
    New York, New York, Lebanon
    Posts
    1,449
    Thanks
    1
    Thanked 1 Time in 1 Post

    Re: Where to place the last Toolbar (Word 97 and >

    <img src=/S/hello.gif border=0 alt=hello width=25 height=29> Jefferson

    This is precisely why I have to write the code. Not that I am a neat freak, but on laptops screens it does make a difference when a toolbar gets placed all by itself on a row while there are ample space on other rows.

    I'll try and contact Chris and see what he can help with.

    Wassim
    <img src=/S/compute.gif border=0 alt=compute width=40 height=20> in the <img src=/S/bagged.gif border=0 alt=bagged width=22 height=22>

Posting Permissions

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