Outlook 2002 vs Outlook 2003

S

seacuke

I've created an add-in that I've been testing on Outlook 2003.
Basically the add-in creates a button on the standard toolbar for an
email; the call to add the button is below:

syncButton = (CommandBarButton)commandBars["Standard"].Controls.Add(
Microsoft.Office.Core.MsoControlType.msoControlButton,
System.Reflection.Missing.Value,
System.Reflection.Missing.Value,
4,
true);

The last value (true) is indicating whether the button is temporary or
not.
On OLK2003, the button functions just fine - It's created on launching
an email, and disappears when the email is closed.
On OLK2002, the temporary flag is seemingly ignored, for each email I
open, a new 'synchronize' button appears (so soon my toolbar is full of
them).

I'm using the PIA "Microsoft Outlook 11.0 Object Library" version 9.2.

Thanks in advance,
'cuke
 
H

Helmut Obertanner

Hello seacuke,

remove the button in InspectorClose event.

just syncButton.Delete(false);

--
regards

Helmut Obertanner
Technical Consultant

Softwaredevelopment
DATALOG Software AG | Zschokkestr. 36 | D-80687 Munich
web: www.datalog.de


.... and IT works!
 
S

seacuke

Hi Helmut,

I tried placing the syncButton.delete inside the active inspector's
close event, and while it had no effect on OLK2003 (this is good), it
has resulted in very strange behavior on OLK2002. For any given
session the behavior is good (new buttons are not added).

However, when Outlook closes and then is opened again, various things
seem to happen:

1) A new Sync button is added on the first email opened.
2) Sometimes the Outlook session is closed down behind the email
opened. (?)
3) I received a COM error one time (not readily reproducable) that
says that the synchButton could not be deleted.

The flakiness leads me to believe there's a problem in the
surrounding code, let me explain the basic process and see if it makes
sense:

AddIn.onConnect:
Grab instance of the Outlook object.
AddIn.OnStartUpComplete:
Grab an instance of the Application Object's inspector.
Add an event handler to the inspector to be fired when a
"NewInspectorEvent" happens.

AddIn.NewInspectorEventHandler:
Check inspector.currentItem. If it's a mail item, launch a new
'SynchMail' object.

AddIn.Disconnect
if the Inspector isn't null, Release it.
if the Application Object isn't null, Release it.
Garbage Collect


SynchMail.constructor
Get active mail item.
Add event handler to active mail item.open

SynchMail.activeMailItemOpenHandler
Remove event
grab the mail item's active inspector
Add a close event handler to activeMailItem.
Call addUI

SynchMail.AddUI
Create a button on the standard task bar
Add event handler to the button

SynchMail.HandleButtonPressed
Do my functionality

SynchMail.CloseEventHandler
Remove the CloseEventHandler from the active inspectors events
delete the button.
release the active inspector
release the active mail item



In a little more testing I've discovered much to my chagrin that the
'outlook closing itself' issue happens on both OLK2003 and OLK2002 at
this point. I'm suspicious of my logic flow, but really am in the dark
about what I could be doing wrong.

As an aside, do you know how to reset the toolbar on OLK2002? When I
am in a mail message (where all the spurrious synch buttons are), the
'add or remove buttons' menu items are both greyed out.

Cheers,
'cuke




Helmut said:
Hello seacuke,

remove the button in InspectorClose event.

just syncButton.Delete(false);

--
regards

Helmut Obertanner
Technical Consultant

Softwaredevelopment
DATALOG Software AG | Zschokkestr. 36 | D-80687 Munich
web: www.datalog.de


... and IT works!

seacuke said:
I've created an add-in that I've been testing on Outlook 2003.
Basically the add-in creates a button on the standard toolbar for an
email; the call to add the button is below:

syncButton = (CommandBarButton)commandBars["Standard"].Controls.Add(
Microsoft.Office.Core.MsoControlType.msoControlButton,
System.Reflection.Missing.Value,
System.Reflection.Missing.Value,
4,
true);

The last value (true) is indicating whether the button is temporary or
not.
On OLK2003, the button functions just fine - It's created on launching
an email, and disappears when the email is closed.
On OLK2002, the temporary flag is seemingly ignored, for each email I
open, a new 'synchronize' button appears (so soon my toolbar is full of
them).

I'm using the PIA "Microsoft Outlook 11.0 Object Library" version 9.2.

Thanks in advance,
'cuke
 
H

Helmut Obertanner

Hello,
see here (nearly end of thread):

http://www.outlookcode.com/threads.aspx?forumid=5&messageid=10480

when create the Bar loop over the buttons and cleanup.

try
{
// try to find the CommandBar
foreach (MSO.CommandBar bar in myInspector.CommandBars)
{
if (bar.Name == "XConnect")
{
myCommandBar = bar; // foo, eyh ?
break;
}
}

// If we found our CommandBar, we can use it
if (myCommandBar == null)
{
// if not we create one
myCommandBar = myInspector.CommandBars.Add ("XConnect",
0 , myMissing, false);
}

myCommandBar.Position = MSO.MsoBarPosition.msoBarLeft ;
myCommandBar.Visible = true;

// try to find my button CommandBar
myButton = (MSO.CommandBarButton) myCommandBar.FindControl
(MSO.MsoControlType.msoControlButton ,myMissing, "XMail0.1", myMissing,
false);

// If we found our Button, we can use it
if (myButton == null)
{
// if not we create one
myButton = (MSO.CommandBarButton)
myCommandBar.Controls.Add (MSO.MsoControlType.msoControlButton, myMissing,
myMissing,myMissing, false);

myButton.Caption = "XMail";
myButton.Tag = "XMail0.1";
}

--
greets,

Helmut Obertanner
Technical Consultant

Softwaredevelopment
DATALOG Software AG | Zschokkestr. 36 | D-80687 Munich
web: www.datalog.de


.... and IT works!

seacuke said:
Hi Helmut,

I tried placing the syncButton.delete inside the active inspector's
close event, and while it had no effect on OLK2003 (this is good), it
has resulted in very strange behavior on OLK2002. For any given
session the behavior is good (new buttons are not added).

However, when Outlook closes and then is opened again, various things
seem to happen:

1) A new Sync button is added on the first email opened.
2) Sometimes the Outlook session is closed down behind the email
opened. (?)
3) I received a COM error one time (not readily reproducable) that
says that the synchButton could not be deleted.

The flakiness leads me to believe there's a problem in the
surrounding code, let me explain the basic process and see if it makes
sense:

AddIn.onConnect:
Grab instance of the Outlook object.
AddIn.OnStartUpComplete:
Grab an instance of the Application Object's inspector.
Add an event handler to the inspector to be fired when a
"NewInspectorEvent" happens.

AddIn.NewInspectorEventHandler:
Check inspector.currentItem. If it's a mail item, launch a new
'SynchMail' object.

AddIn.Disconnect
if the Inspector isn't null, Release it.
if the Application Object isn't null, Release it.
Garbage Collect


SynchMail.constructor
Get active mail item.
Add event handler to active mail item.open

SynchMail.activeMailItemOpenHandler
Remove event
grab the mail item's active inspector
Add a close event handler to activeMailItem.
Call addUI

SynchMail.AddUI
Create a button on the standard task bar
Add event handler to the button

SynchMail.HandleButtonPressed
Do my functionality

SynchMail.CloseEventHandler
Remove the CloseEventHandler from the active inspectors events
delete the button.
release the active inspector
release the active mail item



In a little more testing I've discovered much to my chagrin that the
'outlook closing itself' issue happens on both OLK2003 and OLK2002 at
this point. I'm suspicious of my logic flow, but really am in the dark
about what I could be doing wrong.

As an aside, do you know how to reset the toolbar on OLK2002? When I
am in a mail message (where all the spurrious synch buttons are), the
'add or remove buttons' menu items are both greyed out.

Cheers,
'cuke




Helmut said:
Hello seacuke,

remove the button in InspectorClose event.

just syncButton.Delete(false);

--
regards

Helmut Obertanner
Technical Consultant

Softwaredevelopment
DATALOG Software AG | Zschokkestr. 36 | D-80687 Munich
web: www.datalog.de


... and IT works!

seacuke said:
I've created an add-in that I've been testing on Outlook 2003.
Basically the add-in creates a button on the standard toolbar for an
email; the call to add the button is below:

syncButton = (CommandBarButton)commandBars["Standard"].Controls.Add(
Microsoft.Office.Core.MsoControlType.msoControlButton,
System.Reflection.Missing.Value,
System.Reflection.Missing.Value,
4,
true);

The last value (true) is indicating whether the button is temporary or
not.
On OLK2003, the button functions just fine - It's created on launching
an email, and disappears when the email is closed.
On OLK2002, the temporary flag is seemingly ignored, for each email I
open, a new 'synchronize' button appears (so soon my toolbar is full of
them).

I'm using the PIA "Microsoft Outlook 11.0 Object Library" version 9.2.

Thanks in advance,
'cuke
 
S

seacuke

Hi Helmut,

In looking at that thread, I noticed a post higher up that says:

1. No, my example is only compatible for Outlook 2003.
If you want to be compatible to Outlook 2000 and Outlook XP you have 3
Options:

1. Develop in an Outlook 2000 Evironment, create your own PIA's
2. Develop with Latebinding (It's a bit hard to)
3. Easiest: Develop with VB6 against Outlook 2000


So it would seem I'm out of luck for hitting against OLK2002 and
earlier anyways.

Being as I don't know how to write VB at all, and I don't have time
to create my own PIAs, it looks like I have to develop with late
binding. Do you have a link to somewhere I could read about late
binding?

Thanks,
brian




Helmut said:
Hello,
see here (nearly end of thread):

http://www.outlookcode.com/threads.aspx?forumid=5&messageid=10480

when create the Bar loop over the buttons and cleanup.

try
{
// try to find the CommandBar
foreach (MSO.CommandBar bar in myInspector.CommandBars)
{
if (bar.Name == "XConnect")
{
myCommandBar = bar; // foo, eyh ?
break;
}
}

// If we found our CommandBar, we can use it
if (myCommandBar == null)
{
// if not we create one
myCommandBar = myInspector.CommandBars.Add ("XConnect",
0 , myMissing, false);
}

myCommandBar.Position = MSO.MsoBarPosition.msoBarLeft ;
myCommandBar.Visible = true;

// try to find my button CommandBar
myButton = (MSO.CommandBarButton) myCommandBar.FindControl
(MSO.MsoControlType.msoControlButton ,myMissing, "XMail0.1", myMissing,
false);

// If we found our Button, we can use it
if (myButton == null)
{
// if not we create one
myButton = (MSO.CommandBarButton)
myCommandBar.Controls.Add (MSO.MsoControlType.msoControlButton, myMissing,
myMissing,myMissing, false);

myButton.Caption = "XMail";
myButton.Tag = "XMail0.1";
}

--
greets,

Helmut Obertanner
Technical Consultant

Softwaredevelopment
DATALOG Software AG | Zschokkestr. 36 | D-80687 Munich
web: www.datalog.de


... and IT works!

seacuke said:
Hi Helmut,

I tried placing the syncButton.delete inside the active inspector's
close event, and while it had no effect on OLK2003 (this is good), it
has resulted in very strange behavior on OLK2002. For any given
session the behavior is good (new buttons are not added).

However, when Outlook closes and then is opened again, various things
seem to happen:

1) A new Sync button is added on the first email opened.
2) Sometimes the Outlook session is closed down behind the email
opened. (?)
3) I received a COM error one time (not readily reproducable) that
says that the synchButton could not be deleted.

The flakiness leads me to believe there's a problem in the
surrounding code, let me explain the basic process and see if it makes
sense:

AddIn.onConnect:
Grab instance of the Outlook object.
AddIn.OnStartUpComplete:
Grab an instance of the Application Object's inspector.
Add an event handler to the inspector to be fired when a
"NewInspectorEvent" happens.

AddIn.NewInspectorEventHandler:
Check inspector.currentItem. If it's a mail item, launch a new
'SynchMail' object.

AddIn.Disconnect
if the Inspector isn't null, Release it.
if the Application Object isn't null, Release it.
Garbage Collect


SynchMail.constructor
Get active mail item.
Add event handler to active mail item.open

SynchMail.activeMailItemOpenHandler
Remove event
grab the mail item's active inspector
Add a close event handler to activeMailItem.
Call addUI

SynchMail.AddUI
Create a button on the standard task bar
Add event handler to the button

SynchMail.HandleButtonPressed
Do my functionality

SynchMail.CloseEventHandler
Remove the CloseEventHandler from the active inspectors events
delete the button.
release the active inspector
release the active mail item



In a little more testing I've discovered much to my chagrin that the
'outlook closing itself' issue happens on both OLK2003 and OLK2002 at
this point. I'm suspicious of my logic flow, but really am in the dark
about what I could be doing wrong.

As an aside, do you know how to reset the toolbar on OLK2002? When I
am in a mail message (where all the spurrious synch buttons are), the
'add or remove buttons' menu items are both greyed out.

Cheers,
'cuke




Helmut said:
Hello seacuke,

remove the button in InspectorClose event.

just syncButton.Delete(false);

--
regards

Helmut Obertanner
Technical Consultant

Softwaredevelopment
DATALOG Software AG | Zschokkestr. 36 | D-80687 Munich
web: www.datalog.de


... and IT works!

I've created an add-in that I've been testing on Outlook 2003.
Basically the add-in creates a button on the standard toolbar
for
an
email; the call to add the button is below:

syncButton = (CommandBarButton)commandBars["Standard"].Controls.Add(
Microsoft.Office.Core.MsoControlType.msoControlButton,
System.Reflection.Missing.Value,
System.Reflection.Missing.Value,
4,
true);

The last value (true) is indicating whether the button is
temporary
or
not.
On OLK2003, the button functions just fine - It's created on launching
an email, and disappears when the email is closed.
On OLK2002, the temporary flag is seemingly ignored, for each
email
I
open, a new 'synchronize' button appears (so soon my toolbar is full of
them).

I'm using the PIA "Microsoft Outlook 11.0 Object Library"
version
9.2.
Thanks in advance,
'cuke
 
H

Helmut Obertanner

Hello seacuke,

creating a PIA is done with the tlbimp tool.
Open the Visual Studio Commandprompt.
locate the dll you want to import (msoutl9.olb) copy to c:\temp
change to c:\temp
if you don't have a keyfile, generate one with
sn -k mykey.snk
now type
tlbimp /keyfile:mykey.snk outlk9.olb
a .dll file is generated (the PIA)
add the PIA.dll and your keyfile to your solution
add a reference to the PIA dll.
select the keyfile in your project settings
this PIA must be distributed with your app.

done.
hope this helps

--
regards

Helmut Obertanner
Technical Consultant

Softwaredevelopment
DATALOG Software AG | Zschokkestr. 36 | D-80687 Munich
web: www.datalog.de


.... and IT works!

seacuke said:
Hi Helmut,

In looking at that thread, I noticed a post higher up that says:

1. No, my example is only compatible for Outlook 2003.
If you want to be compatible to Outlook 2000 and Outlook XP you have 3
Options:

1. Develop in an Outlook 2000 Evironment, create your own PIA's
2. Develop with Latebinding (It's a bit hard to)
3. Easiest: Develop with VB6 against Outlook 2000


So it would seem I'm out of luck for hitting against OLK2002 and
earlier anyways.

Being as I don't know how to write VB at all, and I don't have time
to create my own PIAs, it looks like I have to develop with late
binding. Do you have a link to somewhere I could read about late
binding?

Thanks,
brian




Helmut said:
Hello,
see here (nearly end of thread):

http://www.outlookcode.com/threads.aspx?forumid=5&messageid=10480

when create the Bar loop over the buttons and cleanup.

try
{
// try to find the CommandBar
foreach (MSO.CommandBar bar in myInspector.CommandBars)
{
if (bar.Name == "XConnect")
{
myCommandBar = bar; // foo, eyh ?
break;
}
}

// If we found our CommandBar, we can use it
if (myCommandBar == null)
{
// if not we create one
myCommandBar = myInspector.CommandBars.Add ("XConnect",
0 , myMissing, false);
}

myCommandBar.Position = MSO.MsoBarPosition.msoBarLeft ;
myCommandBar.Visible = true;

// try to find my button CommandBar
myButton = (MSO.CommandBarButton) myCommandBar.FindControl
(MSO.MsoControlType.msoControlButton ,myMissing, "XMail0.1", myMissing,
false);

// If we found our Button, we can use it
if (myButton == null)
{
// if not we create one
myButton = (MSO.CommandBarButton)
myCommandBar.Controls.Add (MSO.MsoControlType.msoControlButton, myMissing,
myMissing,myMissing, false);

myButton.Caption = "XMail";
myButton.Tag = "XMail0.1";
}

--
greets,

Helmut Obertanner
Technical Consultant

Softwaredevelopment
DATALOG Software AG | Zschokkestr. 36 | D-80687 Munich
web: www.datalog.de


... and IT works!

seacuke said:
Hi Helmut,

I tried placing the syncButton.delete inside the active inspector's
close event, and while it had no effect on OLK2003 (this is good), it
has resulted in very strange behavior on OLK2002. For any given
session the behavior is good (new buttons are not added).

However, when Outlook closes and then is opened again, various things
seem to happen:

1) A new Sync button is added on the first email opened.
2) Sometimes the Outlook session is closed down behind the email
opened. (?)
3) I received a COM error one time (not readily reproducable) that
says that the synchButton could not be deleted.

The flakiness leads me to believe there's a problem in the
surrounding code, let me explain the basic process and see if it makes
sense:

AddIn.onConnect:
Grab instance of the Outlook object.
AddIn.OnStartUpComplete:
Grab an instance of the Application Object's inspector.
Add an event handler to the inspector to be fired when a
"NewInspectorEvent" happens.

AddIn.NewInspectorEventHandler:
Check inspector.currentItem. If it's a mail item, launch a new
'SynchMail' object.

AddIn.Disconnect
if the Inspector isn't null, Release it.
if the Application Object isn't null, Release it.
Garbage Collect


SynchMail.constructor
Get active mail item.
Add event handler to active mail item.open

SynchMail.activeMailItemOpenHandler
Remove event
grab the mail item's active inspector
Add a close event handler to activeMailItem.
Call addUI

SynchMail.AddUI
Create a button on the standard task bar
Add event handler to the button

SynchMail.HandleButtonPressed
Do my functionality

SynchMail.CloseEventHandler
Remove the CloseEventHandler from the active inspectors events
delete the button.
release the active inspector
release the active mail item



In a little more testing I've discovered much to my chagrin that the
'outlook closing itself' issue happens on both OLK2003 and OLK2002 at
this point. I'm suspicious of my logic flow, but really am in the dark
about what I could be doing wrong.

As an aside, do you know how to reset the toolbar on OLK2002? When I
am in a mail message (where all the spurrious synch buttons are), the
'add or remove buttons' menu items are both greyed out.

Cheers,
'cuke




Helmut Obertanner wrote:
Hello seacuke,

remove the button in InspectorClose event.

just syncButton.Delete(false);

--
regards

Helmut Obertanner
Technical Consultant

Softwaredevelopment
DATALOG Software AG | Zschokkestr. 36 | D-80687 Munich
web: www.datalog.de


... and IT works!

I've created an add-in that I've been testing on Outlook 2003.
Basically the add-in creates a button on the standard toolbar for
an
email; the call to add the button is below:

syncButton =
(CommandBarButton)commandBars["Standard"].Controls.Add(
Microsoft.Office.Core.MsoControlType.msoControlButton,
System.Reflection.Missing.Value,
System.Reflection.Missing.Value,
4,
true);

The last value (true) is indicating whether the button is temporary
or
not.
On OLK2003, the button functions just fine - It's created on
launching
an email, and disappears when the email is closed.
On OLK2002, the temporary flag is seemingly ignored, for each email
I
open, a new 'synchronize' button appears (so soon my toolbar is
full of
them).

I'm using the PIA "Microsoft Outlook 11.0 Object Library" version
9.2.

Thanks in advance,
'cuke
 
H

Helmut Obertanner

type
tlbimp /keyfile:mykey.snk msoutl9.olb
instead of
tlbimp /keyfile:mykey.snk outlk9.olb

--
regards

Helmut Obertanner
Technical Consultant

Softwaredevelopment
DATALOG Software AG | Zschokkestr. 36 | D-80687 Munich
web: www.datalog.de


.... and IT works!

Helmut Obertanner said:
Hello seacuke,

creating a PIA is done with the tlbimp tool.
Open the Visual Studio Commandprompt.
locate the dll you want to import (msoutl9.olb) copy to c:\temp
change to c:\temp
if you don't have a keyfile, generate one with
sn -k mykey.snk
now type
tlbimp /keyfile:mykey.snk outlk9.olb
a .dll file is generated (the PIA)
add the PIA.dll and your keyfile to your solution
add a reference to the PIA dll.
select the keyfile in your project settings
this PIA must be distributed with your app.

done.
hope this helps

--
regards

Helmut Obertanner
Technical Consultant

Softwaredevelopment
DATALOG Software AG | Zschokkestr. 36 | D-80687 Munich
web: www.datalog.de


... and IT works!

seacuke said:
Hi Helmut,

In looking at that thread, I noticed a post higher up that says:

1. No, my example is only compatible for Outlook 2003.
If you want to be compatible to Outlook 2000 and Outlook XP you have 3
Options:

1. Develop in an Outlook 2000 Evironment, create your own PIA's
2. Develop with Latebinding (It's a bit hard to)
3. Easiest: Develop with VB6 against Outlook 2000


So it would seem I'm out of luck for hitting against OLK2002 and
earlier anyways.

Being as I don't know how to write VB at all, and I don't have time
to create my own PIAs, it looks like I have to develop with late
binding. Do you have a link to somewhere I could read about late
binding?

Thanks,
brian




Helmut said:
Hello,
see here (nearly end of thread):

http://www.outlookcode.com/threads.aspx?forumid=5&messageid=10480

when create the Bar loop over the buttons and cleanup.

try
{
// try to find the CommandBar
foreach (MSO.CommandBar bar in myInspector.CommandBars)
{
if (bar.Name == "XConnect")
{
myCommandBar = bar; // foo, eyh ?
break;
}
}

// If we found our CommandBar, we can use it
if (myCommandBar == null)
{
// if not we create one
myCommandBar = myInspector.CommandBars.Add ("XConnect",
0 , myMissing, false);
}

myCommandBar.Position = MSO.MsoBarPosition.msoBarLeft ;
myCommandBar.Visible = true;

// try to find my button CommandBar
myButton = (MSO.CommandBarButton) myCommandBar.FindControl
(MSO.MsoControlType.msoControlButton ,myMissing, "XMail0.1", myMissing,
false);

// If we found our Button, we can use it
if (myButton == null)
{
// if not we create one
myButton = (MSO.CommandBarButton)
myCommandBar.Controls.Add (MSO.MsoControlType.msoControlButton, myMissing,
myMissing,myMissing, false);

myButton.Caption = "XMail";
myButton.Tag = "XMail0.1";
}

--
greets,

Helmut Obertanner
Technical Consultant

Softwaredevelopment
DATALOG Software AG | Zschokkestr. 36 | D-80687 Munich
web: www.datalog.de


... and IT works!

Hi Helmut,

I tried placing the syncButton.delete inside the active inspector's
close event, and while it had no effect on OLK2003 (this is good), it
has resulted in very strange behavior on OLK2002. For any given
session the behavior is good (new buttons are not added).

However, when Outlook closes and then is opened again, various things
seem to happen:

1) A new Sync button is added on the first email opened.
2) Sometimes the Outlook session is closed down behind the email
opened. (?)
3) I received a COM error one time (not readily reproducable) that
says that the synchButton could not be deleted.

The flakiness leads me to believe there's a problem in the
surrounding code, let me explain the basic process and see if it makes
sense:

AddIn.onConnect:
Grab instance of the Outlook object.
AddIn.OnStartUpComplete:
Grab an instance of the Application Object's inspector.
Add an event handler to the inspector to be fired when a
"NewInspectorEvent" happens.

AddIn.NewInspectorEventHandler:
Check inspector.currentItem. If it's a mail item, launch a new
'SynchMail' object.

AddIn.Disconnect
if the Inspector isn't null, Release it.
if the Application Object isn't null, Release it.
Garbage Collect


SynchMail.constructor
Get active mail item.
Add event handler to active mail item.open

SynchMail.activeMailItemOpenHandler
Remove event
grab the mail item's active inspector
Add a close event handler to activeMailItem.
Call addUI

SynchMail.AddUI
Create a button on the standard task bar
Add event handler to the button

SynchMail.HandleButtonPressed
Do my functionality

SynchMail.CloseEventHandler
Remove the CloseEventHandler from the active inspectors events
delete the button.
release the active inspector
release the active mail item



In a little more testing I've discovered much to my chagrin that the
'outlook closing itself' issue happens on both OLK2003 and OLK2002 at
this point. I'm suspicious of my logic flow, but really am in the dark
about what I could be doing wrong.

As an aside, do you know how to reset the toolbar on OLK2002? When I
am in a mail message (where all the spurrious synch buttons are), the
'add or remove buttons' menu items are both greyed out.

Cheers,
'cuke




Helmut Obertanner wrote:
Hello seacuke,

remove the button in InspectorClose event.

just syncButton.Delete(false);

--
regards

Helmut Obertanner
Technical Consultant

Softwaredevelopment
DATALOG Software AG | Zschokkestr. 36 | D-80687 Munich
web: www.datalog.de


... and IT works!

I've created an add-in that I've been testing on Outlook 2003.
Basically the add-in creates a button on the standard toolbar for
an
email; the call to add the button is below:

syncButton =
(CommandBarButton)commandBars["Standard"].Controls.Add(
Microsoft.Office.Core.MsoControlType.msoControlButton,
System.Reflection.Missing.Value,
System.Reflection.Missing.Value,
4,
true);

The last value (true) is indicating whether the button is temporary
or
not.
On OLK2003, the button functions just fine - It's created on
launching
an email, and disappears when the email is closed.
On OLK2002, the temporary flag is seemingly ignored, for each email
I
open, a new 'synchronize' button appears (so soon my toolbar is
full of
them).

I'm using the PIA "Microsoft Outlook 11.0 Object Library" version
9.2.

Thanks in advance,
'cuke
 
S

seacuke

Hi Helmut,

The business with creating the DLL, I think I did this before I began
any development on the project. If I did *not* do this, would the
add-in function at all in a non OLK2003 environment?

Because it is working on the OLK2002, and having the
check-for-the-button-already-existing code in place fixed the other
problem as well. Thanks a bunch.

-brian/seacuke
 
H

Helmut Obertanner

Hello seacuke,
add-in function at all in a non OLK2003 environment?
don't think so.
You must have a reference to the dll and a keyfile or the PIA.

but I'm not sure, must test...

--
regards

Helmut Obertanner
Technical Consultant

Softwaredevelopment
DATALOG Software AG | Zschokkestr. 36 | D-80687 Munich
web: www.datalog.de


.... and IT works!
 

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