(Newbie Question) How to Write a Add-in?

2

2R

Dear all,

I am new in writing Add-in but I am an advanced programmer in VB.net. I am trying to test writing some add-in for Outlook XP. The testing program is just to show a messge box when it is connected, but no matter I try, I fail...


relevant code below (class 1): -

--------------------------------------------------------------------------------

Private Sub IDTExtensibility2_OnConnection(ByVal Application As Object, ByVal ConnectMode As AddInDesignerObjects.ext_ConnectMode, ByVal AddInInst As Object, custom() As Variant)

MsgBox "no"
On Error Resume Next
Select Case ConnectMode

Case ext_cm_Startup
Msgbox "yes"
Case ext_cm_AfterStartup

Case ext_cm_CommandLine 'Not used in Office 2000 COM add-ins

Case ext_cm_External 'Not used in Office 2000 COM add-ins

End Select

Call InitHandler(Application, AddInInst.ProgId)

End Sub


--------------------------------------------------------------------------------

Private Sub InitHandler(oApp As Outlook.Application, sProgID As String)

On Error Resume Next

Set moOL = oApp

Set moNS = oApp.GetNamespace("MAPI")

Set moActiveExplorer = moOL.ActiveExplorer


msProgID = sProgID

End Sub

--------------------------------------------------------------------------------


Exactly I write that in reference to Ken Slovak's book. I remove all others non-relevant subroutines.

I am using Office XP Developer and the MOD in writing the Add-in.

Step:
1. In the Add-in Desinger -> type addin display, description, select "Microsoft Outlook" in Application, "Microsoft Outlook 10.0" in Application Version, "Startup" in Initial Load Behaviour.
2. Save the add-in
3. compile the add-in to my program directory
4. Check if the "Custom Add-in" has it checked.
5. Quit Outlook and restart.

But there is no response.

Thanks.
 
K

Ken Slovak - [MVP - Outlook]

See http://www.microeye.com/resources/res_outlookvsnet.htm for information
about writing COM addins using .NET languages.




Dear all,

I am new in writing Add-in but I am an advanced programmer in VB.net. I am
trying to test writing some add-in for Outlook XP. The testing program is
just to show a messge box when it is connected, but no matter I try, I
fail...


relevant code below (class 1): -



Private Sub IDTExtensibility2_OnConnection(ByVal Application As Object,
ByVal ConnectMode As AddInDesignerObjects.ext_ConnectMode, ByVal AddInInst
As Object, custom() As Variant)

MsgBox "no"
On Error Resume Next
Select Case ConnectMode

Case ext_cm_Startup
Msgbox "yes"
Case ext_cm_AfterStartup

Case ext_cm_CommandLine 'Not used in Office 2000 COM add-ins

Case ext_cm_External 'Not used in Office 2000 COM add-ins

End Select

Call InitHandler(Application, AddInInst.ProgId)

End Sub




Private Sub InitHandler(oApp As Outlook.Application, sProgID As String)

On Error Resume Next

Set moOL = oApp

Set moNS = oApp.GetNamespace("MAPI")

Set moActiveExplorer = moOL.ActiveExplorer


msProgID = sProgID

End Sub




Exactly I write that in reference to Ken Slovak's book. I remove all others
non-relevant subroutines.

I am using Office XP Developer and the MOD in writing the Add-in.

Step:
1. In the Add-in Desinger -> type addin display, description, select
"Microsoft Outlook" in Application, "Microsoft Outlook 10.0" in Application
Version, "Startup" in Initial Load Behaviour.
2. Save the add-in
3. compile the add-in to my program directory
4. Check if the "Custom Add-in" has it checked.
5. Quit Outlook and restart.

But there is no response.

Thanks.
 
2

2R

Dear All,

I found something interesting ...

I then wrote a VBA in the "ThisOutlookSession" to check the if the add-in is
connected.

Then I found that it is connected ! Thus, my Add-in is actually connected
but it does not perform what I am expecting.

I refer to the book - Programming Microsoft Outlook 2000 and do find a clue.
I am using the Microsoft Office XP Developer.

My program is very simple, implement the IDTExtensibility2 and just prompt a
message box while it is connected.

Any clue?


Thanks,
 
K

Ken Slovak - [MVP - Outlook]

I have no idea what MOP is.

I can't help much with your problem. I never use .NET languages for Outlook
addins, it's a less than compelling story so I don't have much expertise
there.
 
M

Mike Leftwich

You might take a look at Add-in Express (http://www.add-in-express.com/). Makes writing an add-in very simple.

Mike
Dear all,

I am new in writing Add-in but I am an advanced programmer in VB.net. I am trying to test writing some add-in for Outlook XP. The testing program is just to show a messge box when it is connected, but no matter I try, I fail...


relevant code below (class 1): -

------------------------------------------------------------------------------

Private Sub IDTExtensibility2_OnConnection(ByVal Application As Object, ByVal ConnectMode As AddInDesignerObjects.ext_ConnectMode, ByVal AddInInst As Object, custom() As Variant)

MsgBox "no"
On Error Resume Next
Select Case ConnectMode

Case ext_cm_Startup
Msgbox "yes"
Case ext_cm_AfterStartup

Case ext_cm_CommandLine 'Not used in Office 2000 COM add-ins

Case ext_cm_External 'Not used in Office 2000 COM add-ins

End Select

Call InitHandler(Application, AddInInst.ProgId)

End Sub


------------------------------------------------------------------------------

Private Sub InitHandler(oApp As Outlook.Application, sProgID As String)

On Error Resume Next

Set moOL = oApp

Set moNS = oApp.GetNamespace("MAPI")

Set moActiveExplorer = moOL.ActiveExplorer


msProgID = sProgID

End Sub

------------------------------------------------------------------------------


Exactly I write that in reference to Ken Slovak's book. I remove all others non-relevant subroutines.

I am using Office XP Developer and the MOD in writing the Add-in.

Step:
1. In the Add-in Desinger -> type addin display, description, select "Microsoft Outlook" in Application, "Microsoft Outlook 10.0" in Application Version, "Startup" in Initial Load Behaviour.
2. Save the add-in
3. compile the add-in to my program directory
4. Check if the "Custom Add-in" has it checked.
5. Quit Outlook and restart.

But there is no response.

Thanks.
 
2

2R

Thanks for your reply.

Typo ... MOD - Microsoft Office Developer

I do not understand why my add-in not working .... it is a very simple code,
and I have checked that it is connected, but the code does not executed.
 
2

2R

Dear Mike,

Thanks.

I want to use the MS Office XP Developer for the add-in.



You might take a look at Add-in Express (http://www.add-in-express.com/). Makes writing an add-in very simple.

Mike
Dear all,

I am new in writing Add-in but I am an advanced programmer in VB.net. I am trying to test writing some add-in for Outlook XP. The testing program is just to show a messge box when it is connected, but no matter I try, I fail...


relevant code below (class 1): -

----------------------------------------------------------------------------

Private Sub IDTExtensibility2_OnConnection(ByVal Application As Object, ByVal ConnectMode As AddInDesignerObjects.ext_ConnectMode, ByVal AddInInst As Object, custom() As Variant)

MsgBox "no"
On Error Resume Next
Select Case ConnectMode

Case ext_cm_Startup
Msgbox "yes"
Case ext_cm_AfterStartup

Case ext_cm_CommandLine 'Not used in Office 2000 COM add-ins

Case ext_cm_External 'Not used in Office 2000 COM add-ins

End Select

Call InitHandler(Application, AddInInst.ProgId)

End Sub


----------------------------------------------------------------------------

Private Sub InitHandler(oApp As Outlook.Application, sProgID As String)

On Error Resume Next

Set moOL = oApp

Set moNS = oApp.GetNamespace("MAPI")

Set moActiveExplorer = moOL.ActiveExplorer


msProgID = sProgID

End Sub

----------------------------------------------------------------------------


Exactly I write that in reference to Ken Slovak's book. I remove all others non-relevant subroutines.

I am using Office XP Developer and the MOD in writing the Add-in.

Step:
1. In the Add-in Desinger -> type addin display, description, select "Microsoft Outlook" in Application, "Microsoft Outlook 10.0" in Application Version, "Startup" in Initial Load Behaviour.
2. Save the add-in
3. compile the add-in to my program directory
4. Check if the "Custom Add-in" has it checked.
5. Quit Outlook and restart.

But there is no response.

Thanks.
 

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