Check if VBA Code is Signed

The following code explains how to check if the VBA code is signed or not using the Diagram.VbaProject.IsSigned property. You can use any of your visio files to test this code. For testing purposes, you can use this visio file used in the code.

Sample Code

// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_Shapes();
// Load a diagram
Diagram diagram = new Diagram(dataDir + "1.vsdm");
// Signature is valid
Console.WriteLine("Is VBA Code Project Signed: " + diagram.VbaProject.IsSigned);
diagram.Save(dataDir + "1out.vsdm", SaveFileFormat.VSDM);

Console Output

Below is the console output of the above code using the sample visio file provided by the link.

Is VBA Code Project Signed: False