View Full Version : Positioning CommandBars in Outlook
I am running ol2K. I have been fiddling with repositioning command bars using VBA. Everything seems to work about as I would expect except the "Top" property. If I display the value, the value is correct. But if I try to set the value, the new value is ignored and the old value is retained. There is no error, the new value is just ignored. If I manually reposition the command bar and display the value of Top, it has changed. What is going on here? :dunno
Thanks
mvidas
10-30-2006, 07:25 AM
Hi MWE,
You sure you're trying to set the .top for a command bar and not a command bar control? A CB has a read/write .top property, a CBC is read-only.
Just a thought
Hi MWE,
You sure you're trying to set the .top for a command bar and not a command bar control? A CB has a read/write .top property, a CBC is read-only.
Just a thoughtI am working with a command bar. There is a Dim statement Dim CB as CommandBarFurther, if one tries to set a read-alone property, there will be an error. There is no error.
mvidas
10-31-2006, 07:46 AM
I see what you mean.
I just tried running:Sub dlkajfdasd()
Dim CB As CommandBar, CBC As CommandBarControl
Set CB = ActiveExplorer.CommandBars.Add("MWE", msoBarFloating, False, True)
Set CBC = CB.Controls.Add(msoControlButton)
CB.Visible = True
CB.Top = 50
End SubAnd the .top line did work for me, so I guess it isn't always read-only. However when changing msoBarFloating to msoBarTop I noticed the same behavior you did. Using Debug.Print CB.Top
CB.Top = 5
Debug.Print CB.TopI had no error and '49' was debugged each time. Sorry I misunderstood you yesterday
Matt
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.