Microsoft

MS Project Add-ins using C# or VB.NET

Publish Date: October 13, 2022

Introduction

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

img

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.

Pros

  1. Consists of a managed code assembly that is associated with a Microsoft Office application
  2. Can use any of the classes in the .NET Framework.
  3. Add-in projects include an automatically generated class that represents the VSTO Add-in
  4. The class provides properties and events that can be used to access the (office) object model
  5. Other Visual Studio features such as Windows Forms and an integrated debugger are available
  6. 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.
  7. Suitable for large-scale applications.

Cons

  1. Requires Visual Studio Professional License (i.e., not free), whereas VBA comes embedded
  2. Installer Required – VSTO plugins require the use of an installer.
  3. 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

img

Select the Project for creating the VSTO

img

Create Add-In Ribbon in MS Project

Click on the Project file, and from the component menu, select the Ribbon control as shown below

img

There are two ways to create a ribbon

  1. Ribbon (Visual Designer)
  2. 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

img

Users can view the Ribbon in the MS Projects Add-In

img

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.

img

MS Project allows some existing predefined fields which can be used to display the custom data as per our needs.

img

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.

img

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.

img

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.

img

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.

Summary

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.

Related Posts.

Microsoft , SAP On Azure
Cloud Infrastructure , Production Management , SAP On Azure
Dynamics 365 , Dynamics AX , Microsoft , Microsoft Dynamics 365
Microsoft , Microsoft Dynamic 365
Low-code Tools , Microsoft , Microsoft PowerApps
Content Management System , Microsoft , SharePoint
AI Builder , Microsoft , Power Platform , PowerApps
Low Code , Microsoft , PowerApps
Dynamics 365 , Finance & Operations , Microsoft
Low Code , Microsoft , Power BI , Power Platform , PowerApps
App Dev
Azure , EDI Integrations , Logic Apps , Microsoft
Canvas Apps , Microsoft , PowerApps , Responsive