Strange behavior with commandbar

L

Lars Roland

Hi

I am using an addin that creates a new commandbar in Outlook (running
OL2000). I have a position inside outlook where I want this commandbar to
be placed as default, this position has the folowing properties

---------------------
Position := msoBarTop
Left := 781
Top := 23
---------------------

If I hard code this into my addin like this:

---------------------
Set cbrNewToolbar = golApp.ActiveExplorer.CommandBars.Add _
(Name:=cmdName, Position:=msoBarTop, Temporary:=True)
cbrNewToolbar.Left = 781
cbrNewToolbar.Top = 23
---------------------

Then the commandbar get placed in the folowing position inside outlook

---------------------
Position := msoBarTop
Left := 781
Top := 23
---------------------

I find this very confusing because the position I have hardcoded in my
code is a valid position (I have created an button on the commandbar that
will print the commandbars curent position, so I know! for sure that the
coordinates are legal).

Is there some sort of limit inside outlook, that cause my settings to be
overwritten ? or can I force it to do what I want in some way ?



Thanks in advace

Regards
Lars Roland
 
L

Lars Roland

Hi

Sorry there was a serious typo in my first post (eleminating the problem)
here is the real problem

I am using an addin that creates a new commandbar in Outlook (running
OL2000). I have a position inside outlook where I want this commandbar to
be placed as default, this position has the folowing properties

---------------------
Position := msoBarTop
Left := 781
Top := 23
---------------------

If I hard code this into my addin like this:

---------------------
Set cbrNewToolbar = golApp.ActiveExplorer.CommandBars.Add _
(Name:=cmdName, Position:=msoBarTop, Temporary:=True)
cbrNewToolbar.Left = 781
cbrNewToolbar.Top = 23
---------------------

Then the commandbar get placed in the folowing position inside outlook

---------------------
Position := msoBarTop
Left := 781
Top := 49
---------------------

I find this very confusing because the position I have hardcoded in my
code is a valid position (I have created an button on the commandbar that
will print the commandbars curent position, so I know! for sure that the
coordinates are legal).

Is there some sort of limit inside outlook, that cause my settings to be
overwritten ? or can I force it to do what I want in some way ?


Thanks in advace

Regards
Lars Roland
 
L

Lars Roland

Hi

To answar my own problem, trying to sawe the position of an commandbar in
outlook requires you to save the folowing 4 values, from the given
commandbar object.

Position (type: msoBarPosition)
Top (type: Long)
Left (type: Long)
RowIndex (type: Long)

I did not find this documented anywhere, but the Word people had a
tutuorial about positioning commandbars, and it seams like Outlook and
Word uses the same commandbar positioning model.



Regards.

Lars Roland
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top