Office Development with Visual Studio

Develop Office Business Applications using Visual Studio

June, 2009

Posts
  • Office Development with Visual Studio

    Community Article: Automate Common Office Tasks (Beth Massi)

    • 0 Comments

    If you haven’t seen it yet, we’ve got a new article from Robert Green (MVP) up on the VSTO Dev Center. In this article, learn how you can use Visual Studio to build application-level add-ins that automate common Microsoft Office tasks. It’s a good introduction to Office development with Visual Studio so check it out!

    Create an Application-Level Add-In to Automate Common Office Tasks

    Enjoy,
    -Beth Massi, Visual Studio Community

  • Office Development with Visual Studio

    32bit Visual Studio and 64bit Office (Christin Boyd)

    • 3 Comments

    Visual Studio 2010 will ship with a 32bit version, and no 64bit version.  My team built a very smart layer into Visual Studio 2010 to enable designers and debuggers that work with 64bit Office 2010 and 64bit SharePoint Server 2010. 

    For a good explanation of why the Visual Studio team chose to only build a 32bit version for the next release, you can find a blog post by Rico Mariani titled “Visual Studio: Why is there no 64 bit version? (yet)

    SharePoint Server 2010 will be 64-bit only.  You can learn more about the requirements of Microsoft SharePoint Server 2010 on the SharePoint Team Blog entry “Announcing SharePoint Server 2010 Preliminary System Requirements”  If you plan to build solutions for the next generation of SharePoint Server, then I recommend budgeting to purchase 64bit hardware.

    -Christin Boyd, Program Manager, Visual Studio

  • Office Development with Visual Studio

    Video Interview: Mary Lee on Deploying Multiple Office Solutions (Kathleen McGrath)

    • 1 Comments

    Mary Lee recently posted a blog entry that describes Deploying Multiple Office Solutions in a Single Installer, complete with graphics to help you visualize the process. I recently interviewed Mary to learn more about this topic, and to have her give a demonstration of some of the tasks described in this post.

    clip_image002If you’ve often wondered who’s hidden behind that motorcycle helmet, be sure to check out the video!

     

     

    See video: Deploying Multiple Office Solutions in a Single ClickOnce Installer

    Multi

    I will be posting additional interviews, demonstrations, and featured Visual Studio 2010 Beta 1 content on my blog: http://blogs.msdn.com/kathleen.

     

    -- Kathleen

  • Office Development with Visual Studio

    Use a path that resolves anywhere your VSTO solution could be deployed (Christin Boyd)

    • 1 Comments

    One of the VSTO MVPs pointed out that in some cases his customers were unable to resolve UNC paths consistently.  When he investigated further, he found that some branch offices of an enterprise were unable to resolve the UNC path (\\myserver\myvstoapps\installpath\) because of the way they setup their network infrastructure.  The only workaround he could find was to use a fully qualified web URL instead of a UNC path.  The resolution was to create a web server internal to the corporation which is still accessible by people in the branch office.  The other option would be to negotiate with the IT staff to change the way the branch office resolves server names, but apparently that was not an option.

    We looked at the situation and agree with his conclusion about the workaround.  If the network just won’t give you the correct path using UNC, then HTTP is a reliable solution.

    -Christin Boyd, Program Manager

  • Office Development with Visual Studio

    Do Your Outlook UI Elements Need Counseling? - Get your Form Regions, Ribbons, and Task Panes Talking to Each Other Again (Norm Estabrook)

    • 1 Comments

    So you want to open a task pane by using a button on the Ribbon. You also want a form region that appears in an e-mail item to detect the state of a control on a custom task pane so that you can add or remove an option that appears in a Ribbon menu right? Ok, I completely made this scenario up. But at some point, somewhere along the way, you might say to yourself – how do I get to that gallery on my Ribbon from my task pane? or how do I enable the user to populate that combo box on the form region by selecting a control on the Ribbon? Well if that describes something that you are trying to do, then this post is for you. Let’s start with Ribbons. The other two (form regions and task panes) are bit more troublesome.

    Ribbons

    Ribbon controls are the easiest to access from other areas of your application. Assuming that your custom Ribbon is named Ribbon1, here is what you do:

    ThisRibbonCollection ribbonCollection =
        Globals.Ribbons
            [Globals.ThisAddIn.Application.ActiveInspector()];
    ribbonCollection.Ribbon1.comboBox1.Text = "Hello World";

    You can read more about this here.

    Form Regions

    For the VB folks, this is a snap. C# developers have to do a bit more work. That is because by default, in a C# project, the controls that you add to a form region are private. For each control that you want to access, you have to set the Modifiers property of the control to Internal or Public. For example:

    image

    You can then add code to access the control. For example, assuming that your form region is named FormRegion1, you could use the following code:

    WindowFormRegionCollection formRegions =
        Globals.FormRegions
            [Globals.ThisAddIn.Application.ActiveInspector()];
    formRegions.FormRegion1.textBox1.Text = "Hello World";

    You can read more about this here.

    Custom Task Panes

    Controls on task panes require the same tweaks described for form regions above.  Here is an example of how to get to a button on a task pane. This example makes the following assumptions:

    • The user control of the custom task pane is named MyUserControl.
    • The task pane is named myCustomTaskPane and it is declared as public in your code.

    ((MyUserControl)Globals.ThisAddIn.myCustomTaskPane.Control).button1.Text = "It Worked";

    If have not yet created a custom task pane, see this topic and it will all make sense.

    As a side note, if you are adding custom task panes to Outlook Inspector windows, you have to write a bit of code to map each Inspector window with it’s own instance of a custom task pane. If you don’t do this mapping, you get all kinds of wacky issues.  For an example of how to do this, see the following article.

    For the sake of being thorough, here is an example of how you can access a task pane created by using the guidance in that article

    private void toggleButton1_Click(object sender, RibbonControlEventArgs e)
    {
        Outlook.Inspector inspector = (Outlook.Inspector)e.Control.Context;
        InspectorWrapper inspectorWrapper = Globals.ThisAddIn.InspectorWrappers[inspector];
        CustomTaskPane taskPane = inspectorWrapper.CustomTaskPane;
        if (taskPane != null)
        {
            taskPane.Visible = ((RibbonToggleButton)sender).Checked;
            taskPane.DockPosition = Microsoft.Office.Core.MsoCTPDockPosition.msoCTPDockPositionBottom;
            taskPane.Height = 475;
        }
    }

    Hope this helps!

    Norm E.

Page 1 of 1 (5 items)