I have a Visio diagram. It contains some ‘Excel’ . We tried to remove excel personal information (Like Author, CreatedTime, Modified date), document properties pro-grammatically. But the info not removed from the excel.
Input: Dialog - 28 - Copy.zip (58.7 KB)
public void TestVisioBigExcel()
{
string[] files = Directory.GetFiles(@“C:\Temp\visio”, “*.vsdx”);
foreach(string file in files)
{
Diagram diagram = new Diagram(file, LoadFileFormat.VSDX);
int nFile = 1;
foreach(Aspose.Diagram.Page diagramPage in diagram.Pages)
{
foreach(Aspose.Diagram.Shape OLE_Shape in diagramPage.Shapes)
{
if(OLE_Shape.Type == Aspose.Diagram.TypeValue.Foreign)
{
if(OLE_Shape.ForeignData.ForeignType == ForeignType.Object)
{
Stream Ole_stream = new MemoryStream(OLE_Shape.ForeignData.ObjectData);
// Get format of the OLE file object
Aspose.Cells.FileFormatInfo info = Aspose.Cells.FileFormatUtil.DetectFileFormat(Ole_stream);
if(info.LoadFormat == Aspose.Cells.LoadFormat.Xlsx)
{
// Modify an OLE object
Workbook workbook = new Aspose.Cells.Workbook(new > MemoryStream(OLE_Shape.ForeignData.ObjectData));
workbook.BuiltInDocumentProperties.Clear();
MemoryStream outStream = new MemoryStream();
workbook.Save(outStream, Aspose.Cells.SaveFormat.Xlsx);
OLE_Shape.ForeignData.ObjectData = outStream.ToArray();
nFile++;
// Save back an OLE object
}
}
}
}
}
// Save Visio diagram
diagram.Save($"C:\\Temp\\visio\\out{DateTime.Now.ToString("yyyyMMddHHmmss")}.vsdx", SaveFileFormat.VSDX);
}
}
We have logged an issue as DIAGRAMNET-51850 in our issue tracking system for this scenario. We will further investigate it and keep you posted with the status of its correction. Please be patient and spare us some time.
Thanks for the new version. The ticket DIAGRAMNET-51850 is resolved(Only that file is solved).
W have more visio files. These files have issue not removed the Excel personal info and the visio file shown ‘X’ mark.
We have attached some visio files. Please have look.
We have aspose total licence. We tried with latest version. Please try with below code the problem is exist. If you not getting issue from last attachment files? let us know.
just open and save the visio. it will happen.
Code:
[TestMethod]
public void ConmvertVSDXToVSDX()
{
GetLicense();
Another ticket as DIAGRAMNET-51863 was created in our issue management system for latest files which you shared with us. The ticket is not yet resolved and under the investigation phase. However, we will inform you as soon as it is resolved. Please spare us some time.