Wrox Programmer Forums
|
BOOK: Professional Outlook 2007 Programming ISBN: 978-0-470-04994-5
This is the forum to discuss the Wrox book Professional Outlook 2007 Programming by Ken Slovak; ISBN: 9780470049945
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional Outlook 2007 Programming ISBN: 978-0-470-04994-5 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 13th, 2007, 05:37 PM
Authorized User
 
Join Date: Aug 2004
Posts: 95
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Arsi
Default COM add-in for Outlook 2003 written in VSTO '05 SE

Hello,

Can you point me in the right direction? I need to know how to write one for creating a new menu bar with links to published custom forms in Outlook. Then, I need to distribute it across a company network.

Any help with this would be wonderful.

Thanks,

Arsi

*******(*)*******
__________________
*******(*)*******
 
Old December 13th, 2007, 05:49 PM
Wrox Author
 
Join Date: Sep 2007
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You can't "link" to a published custom form per se. What you'd have to do is to write a macro, say call it OpenFoobar. In that macro you'd have code to open an item using that published form's MessageClass:

   Public Sub OpenFoobar()
     Dim oContact As Outlook.ContactItem

     Set oContact = CreateItem(olContactItem)
     'make it a custom item
     oContact.MessageClass = "IPM.Contact.Foobar"
     oContact.Display
   End Sub

You could also get a reference to a folder's Items collection and use ItemAdd to add the item to a specific folder of course instead of using CreateItem.

Then you customize the menus and add that macro as a new button.

However, distributing VBA macros is not the way to go. It's also very hard to deploy a custom UI like that with VBA code. Deploying the VBA project also destroys any macros the users may already have.

The way to go is to make a COM addin that creates the UI, has the macros and procedures that are called when the buttons are clicked and deploy that. The COM addin code can even deploy and publish the custom forms if desired.

That's the best practice for something like you want.

If you don't know how to make a COM addin buy my book and learn :)



Ken Slovak
 
Old December 13th, 2007, 06:23 PM
Authorized User
 
Join Date: Aug 2004
Posts: 95
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Arsi
Default

Hi Ken,

Thank you for the response.

I've already created the macro to open the form. My issue now is writing the COM addin. I have your book. I'm actually holding it in my hand right now. The problem i'm having is that it describes how to write the COM addin for Outlook 2007 and I need to write it for Outlook 2003 or will do the instructions pertain to Outlook 2003 as well?

I've never written one before.

Thanks for the help.

Arsi

*******(*)*******
 
Old December 13th, 2007, 06:51 PM
Wrox Author
 
Join Date: Sep 2007
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The instructions are relevant to Outlook 2003 but of course anything related to the Ribbon or custom task panes wouldn't be applicable.

Unfortunately the VSTO 2005 SE download projects and templates contain a lot of version specific stuff generated by VSTO and won't let you load the project in a VSTO Outlook 2003 addin.

You are able to load the C# and VB.NET shared addin code or the VB6 addin code and then change the references to Outlook and Office 2003 and remove any Outlook 2007 or Office 2007 specific code or convert it to Outlook 2003 workarounds like Redemption code.

I haven't done it yet but I'm planning on putting up an equivalent set of templates and projects for Outlook 2003 on my Web site soon. I just haven't had time to finish double-checking the code so far.

Those will be projects and templates for Outlook 2003 in VB6, VB.NET & C# shared addins and VSTO C# and VB.NET addins, the equivalents of the Outlook 2007 versions.



Ken Slovak
 
Old December 13th, 2007, 07:05 PM
Authorized User
 
Join Date: Aug 2004
Posts: 95
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Arsi
Default

That's great news! Thanks again. I just have to finish this project in the next 2 days :( I don't think I can do it.

Arsi

*******(*)*******
 
Old December 13th, 2007, 07:20 PM
Wrox Author
 
Join Date: Sep 2007
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Default

2 days is a bit extreme. That's tight even for a very experienced addin developer just to write, tweak, test and debug a simple addin.

There's always debugging no matter what :(

Ken Slovak
 
Old December 13th, 2007, 07:26 PM
Authorized User
 
Join Date: Aug 2004
Posts: 95
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Arsi
Default

Yes! That's true. Wish me luck!


Thanks again,
Arsi

*******(*)*******





Similar Threads
Thread Thread Starter Forum Replies Last Post
Office 2003 absolute minimum w/VSTO? cjkoontz Visual Studio 2005 0 October 16th, 2008 10:36 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.