检查MS Office文件(word,excel.ppt,访问等)是否启用macros或不使用JavaScript

我有一些Office文件…。 我想上传这些文件到数据库…在上传之前,我想检查文件是否启用macros…期待在Java脚本中的解决scheme…

我已经尝试使用以下文件扩展名..

".docm",".dotm",".xlm ",".xltm",".xlsm",".xla",".xlam",".pptm",".potm",".ppsm",".sldm",".ppam",".accde"

但我需要知道任何其他方式来在JS或C#中find解决scheme,

通过处理文件内容并检查其中的任何编程内容。

这些是我尝试的代码…

 var extnsnArray=[".docm",".dotm",".xlm",".xltm",".xlsm",".xla",".xlam",".pptm",".potm",".ppsm",".sldm",".ppam",".accde"] var extnsn = $(file).attr('extension'); if (extnsnArray.indexOf(extnsn) > -1) { // file is macro enabled } else { // file is not macro enabled } 

在PowerPoint的情况下,任何PPTM,PPSM,POTM,PPAM文件或者包含macros,或者是其他types的文件被错误的扩展名,在这种情况下PowerPoint不会打开它。

PPT文件可能包含或不包含macros,如果您需要查看它们,则会使事情更加复杂。