We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

How To Detect If the word document(Old formt '.doc') contains macro or not

I am trying to detect if the .doc file contains macro or not depending on which i’ll convert it to docx or docm ,I am using Aspose.Words for .Net and the file version of dll is 13.10.0.0 and product version is 2013.10.31


I am using .HasMacros property
Document doc = new Document(“C:\Test\Test.doc”);
if(doc.HasMacros)
{
//Yes
}
else
{
//No
}

Hi there,


Thanks for your inquiry. You are using the correct Document’s property. Document.HasMacros property returns true if the document has a VBA project (macros).

Please let us know if you face any issue while using Aspose.Words.