Removing toolbars - again ;)

Joined
Oct 4, 2005
Messages
3
Reaction score
0
Hello all,

I have an addin (must have compatibility from outlook 2000 to 2003). This addin register 2 toolbars, one of them start invisible and if the user want's it, he make it visible by selecting it.

I'm having a problem with toolbar removal on outlook. The next few lines sumarize the options i can see (and have tested) so far:

-> If i create the toolbar with temporary:=False:
In the uninstall procedure i have to open outlook, and logon just to remove the toolbars. And i still have to SHOW outlook to the user. That's horrible. If the user have any message in it's outbox, outlook will ask if he want to send the message, and that's not what i expect of this uninstall procedure. (Is there a way to remove the bars without logging, or showing the outlook? or at least not allowing the user to receive messages while i'm uninstalling?)

-> If i create the toolbar with temporary:=true:
Ok, then i don't have to remove the bar since it's temporary. BUT, if the user customize his environment, like setting my toolbar to bottom, or to the side, when he restart outlook the bars are not in the last position he left. That's specially needed if he selected the toolbar that started invisible, or every time the user will have to select the bar to be visible again. Can i make outlook remember the state of temporary toolbars?

For this second case, which i think shall be easier to find an workaround i have written two functions, one to save the settings of the toolbar in a string and other to load it. The problem is that when i test it in outlook 2000 the following function show a lot of 424 "Object required" errors. But i have logged and bar is not nothing. So, i don't know how to proceed. Can anybody give me a light on this?

Regards,

Code:
Public Sub TextToToolbar(str As String, ByRef bar As Object)
    On Error GoTo ErrorHandler
    
    ' Dont try to load if there is no data
    If (str <> "") Then
        bar.AdaptiveMenu = CBool(getProperty(str, "AdaptiveMenu"))
        bar.Height = CInt(getProperty(str, "Height"))
        bar.Left = CInt(getProperty(str, "Left"))
        bar.Position = CInt(getProperty(str, "Position"))
        bar.RowIndex = CInt(getProperty(str, "RowIndex"))
        bar.Top = CInt(getProperty(str, "Top"))
        bar.Width = CInt(getProperty(str, "Width"))
        bar.Visible = CBool(getProperty(str, "Visible"))
    End If
    
    Exit Sub
ErrorHandler:
    LogWrite "Com - text to toolbar", Err.Description
    Resume Next
End Sub
 

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