A
Aidan Hutchinson
Recently i started working on a Telephony Toolbar for Office 2003 to
control features of our telephony Sip runtime to reflect telephony
presence.
in VB.NET i created a standard shared add-in via the wizard and wrote
some detection routines to detect if the add-in was being used in
Outlook 2003 or any other Office app like Word etc.
it works by trapping the incorrect type of Commandbars object via a
function to return a boolean of sucess depending on if there was an
exception or not using the incorrect type....
Function detect_outlook()
Try
DebugWriter("Detecting for Outlook present...")
'// this method should thow an exception if using outlook
Dim cb As office.CommandBar
Dim cbs As office.CommandBars
cbs = applicationObject.CommandBars
For Each cb In applicationObject.CommandBars
Next cb
'// no error, so office application return false
Return False
Catch ex As Exception
'//detected outlook return true status
Return True
End Try
End Function
then in creating the CommandBars object in the main UI routine .......
If detectedoutlook = False Then
'// use office commandbars
cbs = applicationObject.CommandBars
Else
'// use outlook commandbars
cbs = m_olApp.ActiveExplorer.CommandBars
End If
everything worked ok, cool i thought as usually you have to create a
seperate add-in for Outlook 2003 in vb6 and Word etc, until i read a
..NET MS article which changed my mind and led me to do above.
I created another add-in to control our SIP Softphone, it uses
practically the same code from the first.
Problems started to happen last week when I checked out some of the
toolbar code from VSS and started working on the first toolbar, I
compiled the code & setup installer and ran the setup msi.
Installed ok, ran Word and the toolbar worked as desired (as it has
been in the last month!). Then i tested Outlook and It loaded and
worked ok, no errors in DBMON etc.
This being the initial problem now > when I come to run Word or
Outlook again for the second time the add-in does not load ???
so im thinking the setup installer is not working right and
registering the com add-in ?
ive never come across this before in .NET or VB6, ive tried creating a
new project in the same way and adding the same code and compiling and
the running the add-in and the same happens again.
Is this an registry problem perhaps? its driving me up the wall as
every thing was working fine in the last few weeks.
im using..
WindowsXP Pro
VS.NET 2003 (1.1 fwk)
Office 2003
Im using the office & outlook 2003 object library.
Any help greatfully received !!
Aidan
control features of our telephony Sip runtime to reflect telephony
presence.
in VB.NET i created a standard shared add-in via the wizard and wrote
some detection routines to detect if the add-in was being used in
Outlook 2003 or any other Office app like Word etc.
it works by trapping the incorrect type of Commandbars object via a
function to return a boolean of sucess depending on if there was an
exception or not using the incorrect type....
Function detect_outlook()
Try
DebugWriter("Detecting for Outlook present...")
'// this method should thow an exception if using outlook
Dim cb As office.CommandBar
Dim cbs As office.CommandBars
cbs = applicationObject.CommandBars
For Each cb In applicationObject.CommandBars
Next cb
'// no error, so office application return false
Return False
Catch ex As Exception
'//detected outlook return true status
Return True
End Try
End Function
then in creating the CommandBars object in the main UI routine .......
If detectedoutlook = False Then
'// use office commandbars
cbs = applicationObject.CommandBars
Else
'// use outlook commandbars
cbs = m_olApp.ActiveExplorer.CommandBars
End If
everything worked ok, cool i thought as usually you have to create a
seperate add-in for Outlook 2003 in vb6 and Word etc, until i read a
..NET MS article which changed my mind and led me to do above.
I created another add-in to control our SIP Softphone, it uses
practically the same code from the first.
Problems started to happen last week when I checked out some of the
toolbar code from VSS and started working on the first toolbar, I
compiled the code & setup installer and ran the setup msi.
Installed ok, ran Word and the toolbar worked as desired (as it has
been in the last month!). Then i tested Outlook and It loaded and
worked ok, no errors in DBMON etc.
This being the initial problem now > when I come to run Word or
Outlook again for the second time the add-in does not load ???
so im thinking the setup installer is not working right and
registering the com add-in ?
ive never come across this before in .NET or VB6, ive tried creating a
new project in the same way and adding the same code and compiling and
the running the add-in and the same happens again.
Is this an registry problem perhaps? its driving me up the wall as
every thing was working fine in the last few weeks.
im using..
WindowsXP Pro
VS.NET 2003 (1.1 fwk)
Office 2003
Im using the office & outlook 2003 object library.
Any help greatfully received !!
Aidan