MS Project Add-ins using C# or VB.NETPublish Date: October 13, 2022
Microsoft Project, a project management software product, is designed to assist a project manager in developing a schedule, assigning resources to tasks, tracking progress, managing the budget, and analyzing workloads. The Microsoft Project Add-In is a powerful tool that allows you to connect with External data and existing MPP files.
.Net Add-in Feature using C# or Vb.NET can be used for the existing MS project files (.mpp). In Addition, it offers various features to work on the tasks with its total percentage, start and finish dates, and successors and predecessors. In this article, I will show you how to use the Add-ins feature using Visual Studio IDE to work on the tasks and resources using C#.
For more information, refer to the link
The article is divided into following sections.
- Architecture of VSTO Add-ins
- Pros and Cons of using VSTO
- Create Add-In Project using VSTO
- Create Add-In Ribbon in MS Project
- Milestone Tasks in MS Project File
- Add-In Setup project
The architecture of VSTO Add-Ins
Please refer to the link of Architecture of VSTO Add-Ins
Pros and Cons of using VSTO Add-Ins
VSTO, or Visual Studio Tools for Office, or Microsoft Visual Studio Tools, is part of the Microsoft Visual Studio .NET tools suite and supports the Microsoft .NET Framework. In contrast, VBA, or Visual Basic for Applications, is a computer programming language developed and owned by Microsoft. With VBA, you can create macros to automate repetitive word- and data-processing functions and generate custom forms, graphs, and reports.
- Consists of a managed code assembly that is associated with a Microsoft Office application
- Can use any of the classes in the .NET Framework.
- Add-in projects include an automatically generated class that represents the VSTO Add-in
- The class provides properties and events that can be used to access the (office) object model
- Other Visual Studio features such as Windows Forms and an integrated debugger are available
- VSTO is a part of the Microsoft Visual Studio .Net suite used for developing application-level or document-level Add-ins for Microsoft Office Word, Excel, Access, and Outlook Applications. Microsoft launched VSTO as an alternative to VBA.
- Suitable for large-scale applications.
- Requires Visual Studio Professional License (i.e., not free), whereas VBA comes embedded
- Installer Required – VSTO plugins require the use of an installer.
- More complex development – There is extra frontloaded complexity when developing using VSTO instead of VBA.
Create Add-In Project using VSTO
We have Installed Project 2013 Client Version Tool.
We will be using Visual Studio 2019 as IDE for the development of Add-ins
Select the Project for creating the VSTO
Create Add-In Ribbon in MS Project
Click on the Project file, and from the component menu, select the Ribbon control as shown below
There are two ways to create a ribbon
- Ribbon (Visual Designer)
- Ribbon (XML)
We prefer the ribbon format as it’s very flexible to customize according to our requirements which the Visual designer does not provide.
Below is the Ribbon control in the XML format
Users can view the Ribbon in the MS Projects Add-In
Milestone Tasks in MS Project File
Let’s check how to create and show the Task as a Milestone in the Remark(s) column.
We will use the existing “MPP” file in MS Project and a Custom View, which displays the tasks shown in the below format.
MS Project allows some existing predefined fields which can be used to display the custom data as per our needs.
In our case, we will be using the “Text20” field (Datatype as Text) to display the type of task as Milestone Task in the Remark(s) column.
Below is the code snippet.
Add-In Setup project
To publish the Add-ins, we need to create a setup so the Add-ins can be deployed on any PC having Microsoft Office Project Application.
Enter the Folder Location in which the setup files will be placed.
The prerequisites button can be used to set the target Dotnet Framework. By default, the target framework would be selected, and if the PC on which we install the setup won’t have a .net framework, then the setup installs it and deploys the Add-ins.\
Set the Major, Minor, Build and Revision as per the release version and click on “Publish Now.”
It will create the setup and click on the “setup.exe” which will further deploy Add-ins.
To deploy the setup, the admin needs privileges for the setup to be installed on the PC. If the user lacks the privileges, they could take the IT helpdesk’s help and get the setup installed.
Organizations use Microsoft Project to manage their projects. While these tools are great for creating schedules, they fail to quickly troubleshoot complex activities logically and manage and control real-time project data. It helps to manage time-consuming activities and keep the project plan up to date.
Add-in’s tool is a set of unique software add-on tools that extend features of Microsoft Project. By adding functionality, enhancing existing features, and simplifying the software interface, users can trace through tracking, forecast, and Interpretation with just a simple ‘click.’ It has custom views, and its functionality has proven efficient and effective for every industry that manages projects.
Senior Technical Lead