Emil Hunefalk

Programming Outlook 2007 add-ins with Visual C# 2008 Express

Posted on | September 17, 2009 | 15 Comments

You are currently browsing comments. If you would like to return to the full story, you can read the full entry here: “Programming Outlook 2007 add-ins with Visual C# 2008 Express”.

Comments

15 Responses to “Programming Outlook 2007 add-ins with Visual C# 2008 Express”

  1. Robert
    October 27th, 2009 @ 15:11 pm

    Do need to have Office 2007 installed to test and run your addin?

  2. EH
    October 27th, 2009 @ 15:22 pm

    Hi Robert,

    You need to have Outlook 2007 installed to properly run the add-in I am currently working on (started with the code seen in the post – which of course has later been heavily modified and added to, for example by replacing the Outlook 2003-compatible CommandBarButton with a Ribbon group).

    However, the code in this post should also work with at least Outlook 2003 and 2010. It does work with the Outlook 2007 trial version, which has been used to test it on a local machine here. I don’t know if it works with for example free Outlook Express, as I am currently only developing it for Outlook 2007.

  3. Robert
    October 28th, 2009 @ 13:14 pm

    I install the Primary Interop Assemblies for Microsoft Office 2007. I was able to add the reference to the Microsoft.Office.Core but there was no reference for Microsoft.Office.Interop.Outlook. What am I doing wrong. Do i need to install the trial version of office 2007?

  4. EH
    October 28th, 2009 @ 13:19 pm

    Microsoft.Office.Interop.Outlook comes with the Office 2007 installation – as far as I know you can’t get it separate.

  5. Robert
    October 28th, 2009 @ 15:18 pm

    Do I need to install outlook 2007 to get access to the IDTExensibility Assemblies? How do I add this reference so I can add the line:

    using Extensibility;

    To my code.

  6. EH
    October 28th, 2009 @ 15:27 pm

    You can add a reference to the Extensibility under the .NET tab, with the name “extensibility”. In other words, it’s not under the COM tab with the Office references, and only called extensibility, without “IDT” in the start. There’s some information from MS at http://support.microsoft.com/kb/302901

  7. shivranjani
    January 19th, 2010 @ 12:44 pm

    thanks a lot…Your post really helped to solve my problem.I googled for almost four days, could not find anything.My problem was while adding the key under HKEYLOCALMACHINESOFTWAREMicrosoftOfficeOutlookAddins ,I just added namespace of project not with class namespace.
    Once again thanks a lot.

  8. Tom
    April 5th, 2010 @ 15:01 pm

    Just wanted to ask, where exactly should I see the “hellO” button in outlook 2007?

    I did everything in the article, but I can’t find any changes in the 2007 trial.

    How do I know that the add-in is loaded?

    Thx

  9. Tom
    April 5th, 2010 @ 16:25 pm

    Actually I try to “add” the add-in manually in the COM add-in management window, and the message is that it is not a “valid office add in”

    So I guess something is wrong with the signing?

    help…

  10. EH
    April 5th, 2010 @ 16:46 pm

    If the add-in is loaded you will find a button saying “Hello” in the row with all the menus (File, Edit etc).

  11. Vivek Jain
    April 22nd, 2010 @ 3:55 am

    I am working on addins for outlook 2007.I have 2 mail account and both are configured.I am facing these problem :-

    1. I want to get all there account through c# how to get these account?

    2. How to logout the first account and Login with another account i tried with this code

    OutLookApp.Application.Session.Logoff(); OutLookApp.Application.Session.Logon(missing,missing,false,true);
    But that doesn’t help any clues or suggestion you have?

    Thanks in advance.

  12. EH
    April 22nd, 2010 @ 10:56 am

    Hi Vivek,

    It’s difficult to see exactly what you’re trying to do, and what you want to do with the mail accounts. If you are trying to get information about email, appointments etc from the account, this will exist in stores, which you can iterate through and don’t have to log off one account to access another. To iterate through the stores (which are based on the accounts), you can do something like this:

    foreach (Outlook.Store w_Store in Globals.ThisAddIn.Application.Session.Stores)
                {
                  // Loop over the Top level Folders
                    foreach (Outlook.Folder w_Folder in w_Store.GetRootFolder().Folders)
                    {
                        // Do something useful..
                    }
                }

    Hope this helps

  13. Vivek Jain
    April 23rd, 2010 @ 3:50 am

    Hi Emil,

    Thanks for your reply but my problem is to get the email account Let me explain what i want to do.

    I am creating an add-ins for outlook through this any user those have multiple account configured with outlook can switch his or her account any time.So what i am trying to fetch all the configured account and show in the drpdown.If user select any other account login name password pop-up will display if user is authorized then the his/her mail account will open.

    please send me any suggestion or clue

  14. EH
    April 23rd, 2010 @ 22:32 pm

    Hi Vivek,

    I’m not sure I understand why you want this functionality, unless I’m misunderstanding part of your explanation. You can have multiple email accounts in Outlook at the same time – perhaps you are talking about different profiles?

    This is not a part of Outlook I’ve looked into, but I’ve found some discussions related to profiles in a couple of places:
    - MSDN social
    - office-outlook.com

    Hope it helps

  15. Vivek Jain
    April 26th, 2010 @ 10:52 am

    Thanks for your reply yes Emil i have multiple profile for multiple account.I need to switch from one profile to another without closing the outlook.When i select other profile then the current profile will automatically log-off and prompt me the log-in password box.I tried the link which you suggest but no one is working.BTW Thanks for your help please update me if you find some thing interesting for the same.

    Thanks

Leave a Reply





  • LinkedIn

    If you want to see my LinkedIn profile, click on this button:

    Emil Hunefalk
  • Find & Follow

    hunefalk StumbleUponhunefalk Twitterhunefalk Flickrhunefalk Delicioushunefalk Facebookhunefalk Friendfeedhunefalk LinkedInhunefalk YouTubehunefalk Last.fmhunefalk MyBlogLoghunefalk Google Readerhunefalk Picasawebhunefalk Facebook Profile
  • Comments

  • Tag Cloud

  • addin
  • development
  • mail-client
  • ms-outlook
  • programming
  • visual-csharp