outlook programming with C# - outlook-addin

I am planning to do an add-ins project for Outlook 2007. I am pro developer in C#, WPF.
Please suggest books or sites for me to learn Outlook programming with C#. Any help would be appreciated.
Thanks.

Professional Outlook 2007 Programming ISBN:9780470049945
Programming Applications for Microsoft Office Outlook 2007 ISBN:9780735622494

I am NOT an employee of this company - but I really really like Add-In Express (http://www.add-in-express.com/).
It basically lets you write WinForms style code, embed your WinForms components, deploy and update using ClickOnce (HUGE feature), supports multiple versions of Office products, no VSTO dependency or deployment necessary, easy designer, standard automation model.
To answer your question, reading their tutorials and documentation was sufficient to get started doing extensive Office/Excel/Outlook dev.
Like anything, it has its bugs, but I really like it.

Related

vba or vsto or .. outlook development

Background:
I have come up with an idea that will make things easier for the company I work for. They even seem excited about the idea. The idea is to make an addin for Outlook to help with a task. So after doing a bit of research (obviously, not enough). I downloaded a trial copy of VS2010 pro and created a VSTO addin.
After creating the addin, it was time to package it for a small test deployment. That's when I found out that this is a much more difficult thing to do. It seems MS does not ship Office 2010 with the runtime needed to run VSTO, so i'd have to package that as well. In a company environment, this is not something simple to do.
So, I might have to go back to the drawing board.
Meat of the question:
I've never created an addin for office before, I really want more of a "drop in" solution. I'm not sure if VBA is the right solution. It seems more of a "document" level application (or macro?). Does any one know what would be the best type of solution for this?
Outlook API is not native .NET framework. To interact it with, .NET relies on marshaling and interrop assembly thus making it much more prone to errors and unstable.
From what I've seen so far with my outlook API experience, I would stick with VBA and you should consider retrieving a third party library that exposes outlook extended MAPI if you run in to much of trouble.
NetOffice is pretty good - it is a set of managed .NET libraries that handles the COM API with Office and only needs XCopy installation.
The best part is it tracks all runtime callable wrappers ('RCWs') you create when accessing objects through COM and automatically releases them when you dispose the top-level object (the Application in most cases), so you won't get the issue of an orphaned COM 'handle' preventing you from closing Office.
Alternatively, the Office Primary Interop Assemblies should be on any computer that has the relevant version of Office installed (at least for >= Office 2007). But there are cases when it won't so you will have to cover that possibility. VSTO redistributable should already be installed on any computer with Office 2010 or 2013. For Office 2007 you will need to install it. But again, better safe than sorry so you should include it in your installer in both cases.
For details on deployment options look at http://msdn.microsoft.com/en-us/library/bb386179.aspx
As for VBA, I don't have experience for Outlook addins so I leave that to others to explain. Other VBA Office app addins (Excel/Word/Visio/PPT at least - not sure about the others as I haven't used them) can be installed either using registry keys or through XCopying the addin to a trusted location and then telling the user to open Options/Manage addins and tick the tick box.
I highly recommend Add-in Express. They have tools that go beyond what Microsoft provides via Visual Studio.
Their features for Outlook development greatly reduce the amount of effort required to build Outlook add-ins

Using old macro not working in 2010?

I was trying to run a macro that was designed in for Microsoft Office 2003; however it will not work in Office 2010. Is there a wrapper or some sort of way that I can enable the Office 2010 to read the code?
Thanks for your help and please explain in layman's terms since I really don't have extensive programming knowledge.
You probably need to install the VBA Converter Pack. Follow the link at the top of the support page to download the hotfix.
http://support.microsoft.com/kb/926430/

Excel vba project in VB.NET

I am now engaging in an excel vba project. It's a excel front interface for the workers in a site with an Access database in the company network. I dont like much the VBE in Excel 2007, so im wandering if I can do this with VB.NET, which seems to be a more adorable IDE. And where can I find some resources on this? Or recommanded books? Thanks!
Im using Excel 2007 et VB.NET 2008
You could also try Excel-DNA (free). There are many other products out there too. You can make it work with VB.Net Express also, you just need to add a reference to your excel SDK. Also, Add-in Express looks pretty nice. I've never tried it though (costs money).
I think you are looking for Visual Studio Tools for Office: VSTO.
This allows you to develop using VB.NET (or indeed C#) but with full access to the Office automation facilities.

getting started with Office Outlook add-in?

I'm about to work on some Outlook add-ins. It's been years since I did this; and probably several object model revisions!
Can anyone recommend some references to help get me started: blogs, sites, books??
Thanks
If your budget can afford it (ie. the product is making money), I would highly recommend Add-in Express. Lots of samples, documentation, and support -- but requires using their tooling. (It makes Outlook ever so slightly-less of a PITA to deal with.)
However, if you prefer to stick with a (free with VS) Microsoft solution -- it works fairly well, but is missing some "niceties" -- then check out the VSTO on MSDN page as a first stop an follow the links out. There are also some good sample projects, templates, and VSTO tools on codeplex.
Happy coding.
Edit: I guess I must be bored :-) Here are some selected links that I found helpful. some of these are very specific/advanced, and some are more general. The arrangement is in no particular order.
MSDN Outlook 2010 Top-Level. Links to documentation (MAPI, PIAs) etc.
SGriffin's MAPI Internals. Lots of details wrt MAPI. Generally on low-level access but also a good source to find out about changes, new documentation or tools, etc. He could probably rewrite MAPI from memory.
MFCMAPI Program & Source Invaluable tool for inspecting MAPI folders, properties, and whatnot. Is Microsofts "reference example" for most "How do I do x in MAPI?".
OutlookSpy Program. This isn't free, but there is a trial. It may or may not work better than MFCMAPI for particular needs. This was written by the author of Redemption, a supplement/replacement for the PIA OOM access. Dimastr has also answered a number of (advanced) Outlook/MAPI forum posts online -- always a good person to look out for.
Outlook 2010 Messaging API (MAPI) Code Samples - Covers basic (wrapper) implementations of the providers (address/store/transport). All native C++.
OutlookCode.com Site promotes some Outlook books by Sue Mosher. I can't vouch for the books, but the site is a mixed-blessing with some good links, some useful advice, and some downright ugly code :-) Also has a forum.
Visual Studio Tools for Office in VS2010 has come a long way. I used to make (and sell) an Outlook add-in for Tablet PC's and it was very complicated back then. A properly designed add-in in .NET would need to set up a separate AppDomain to avoid stomping on other add-ins and implement all kinds of workarounds to avoid leaving orphaned Outlook processes when the main window closed.
VSTO does all this "out of the box" now.
Outlook Solutions in Visual Studio
Don't forget this MSDN forum as a great resource:
Outlook for Developers Forum:
http://social.msdn.microsoft.com/Forums/en-US/outlookdev/threads
BTW, #pst: you can still use late-binding to work with the newer Object Models within a version neutral ADX project.
#Josh: VSTO already loads each add-in into it's own AppDomain
#everyone: I work for ADX, feel free to ping me for any questions.

Office 2007 VBA

Amongst the swamp of documentation that is MSDN there is not an article to be found about the latest and greatest tools to be used in conjunction with Office 2007, specifically in the "VBA" department.
We've been using old school versions of Office for many years and had to use VBA. Upgrading to Office 2007 was a prospect for the PDF tools, however ye olde VBA seems to be the only choice of development within it.
Are there not newer .NET tools available? VB.NET, or C#.NET at least? If I have to declare and assign variables on separate lines using VBA one more time I think I may pluck my nose hairs out due to sheer frustration.
Thanks.
VSTO or Visual Studio Tools for Office