Free Support Forum -

How to remove private information, unused shapes, data graphics and styles using Aspose Diagram?


I have a Visio diagram. It contains some private information, unused shapes, data graphics and styles. Is there is any way to Remove unused themes, data graphics and styles (47.4 KB)




Thanks for contacting support.

We have logged your requirements under a ticket ID DIAGRAMNET-51606 in our issue tracking system. We will further investigate them and as soon as logged ticket is resolved, we will surely inform you. Please be patient and spare us little time.

We are sorry for the inconvenience.



We would like to share with you that we are working over providing feature to retrieve themes from Diagram and as soon as the feature is available, we will surely let you know. Furthermore, you may please use diagram.StyleSheets[] to get styles.


Hi Asad,

Thanks for your answer.

Actually we would like to reduce the visio size: by removing the Personal information, Unused Master shapes/Stencils, Styles …

Right now, we use ‘MS visio introp’ to remove those informations like,

The code:
public void TestRemoveVisioUnwantedInfo()
// Arrange
StringBuilder sb = new StringBuilder();

Type VisioType = Type.GetTypeFromProgID("Visio.Application");
if(VisioType == null)
	sb.AppendLine("Visio is not installed.");
InvisibleApp visioApplication = new InvisibleApp
	Visible = false,
	AlertResponse = 1

Document visioDoc = null;
string[] files = Directory.GetFiles(@"C:\Temp\change_visio\");

// Act
foreach(string strFile in files)
		short args = (short) VisOpenSaveArgs.visOpenMacrosDisabled + (short) VisOpenSaveArgs.visOpenDontList;

		visioDoc = visioApplication.Documents.OpenEx(strFile, args);
		visioDoc.RemoveHiddenInformation((int) VisRemoveHiddenInfoItems.visRHIPersonalInfo +
										 (int) VisRemoveHiddenInfoItems.visRHIMasters +
										 (int) VisRemoveHiddenInfoItems.visRHIPreview +
										 (int) VisRemoveHiddenInfoItems.visRHIStyles +
										 (int) VisRemoveHiddenInfoItems.visRHIValidationRules +
										 (int) VisRemoveHiddenInfoItems.visRHIDataRecordsets);

	catch(Exception ex)
		sb.AppendLine("Removing Visio unwanted info is failed - Filename: \t" + strFile);
		sb.AppendLine("Error: \t" + ex.Message + ex.StackTrace);

	if(!File.Exists(strFile)) continue;
	// TODO				



// Assert


But we need to do the above work via Aspose.diagram. We are waiting for your positive reply.

Thank you.



Thanks for providing these details.

We have logged these details as well along with the earlier logged ticket. As shared earlier, we are already working over providing feature to get themes from Diagram, we will definitely consider your other requirements as well during investigation. As soon as some definite updates are available regarding feature availability, we will let you know.