Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Wed Sep 12, 2018 3:53 pm

The following works fine for *.docx and *.docxm, it detects macro correctly
even if I rename the file extensions.

However, if I create a new doc with Office 2010, and save as (Word 97 - 2003) *.doc format,
or use one of your samples, such as fax.doc
it always return true

'VB.NET code:

function hasmacro(sfile as string) as boolean
Dim w As Spire.Doc.Document = New Document

w.LoadFromFileInReadMode(sfile, Spire.Doc.FileFormat.Auto)
'or simply w.LoadFromFile(sfile) 'same result...
return v.IsContainMacro()
end function


Macro detection for excel works fine.
Macro detection for presentation does not seems to be supported

rocky640
 
Posts: 2
Joined: Tue Sep 11, 2018 8:10 pm

Thu Sep 13, 2018 3:48 am

Hello,

Thanks for your inquiry.
Our Free version indeed exists the issue when detecting macro of a *.doc document, sorry for that. Please download our latest commercial edition Spire.Office Platinum (DLL Only) Version:3.8.6 which works well and supports detecting macro of presentation 2007 version or above version. If the issue still exists after trying, please provide your input documents to help us further look into your issue. You could send them to us via email( support@e-iceblue.com).

Sincerely,
Lisa
E-iceblue support team
User avatar

Lisa.Li
 
Posts: 1261
Joined: Wed Apr 25, 2018 3:20 am

Tue Sep 18, 2018 3:03 am

Hello,

Greetings from E-iceblue.
Did the commercial version work for you? Thanks in advance for your valuable feedback and time.

Sincerely,
Lisa
E-iceblue support team
User avatar

Lisa.Li
 
Posts: 1261
Joined: Wed Apr 25, 2018 3:20 am

Tue Sep 18, 2018 6:47 pm

It works very well now. Thank you !

rocky640
 
Posts: 2
Joined: Tue Sep 11, 2018 8:10 pm

Wed Sep 19, 2018 1:05 am

Hello,

Glad to hear that! If you encounter any issue related to our products in the future, just feel free to contact us.
Wish you all the best!

Sincerely,
Lisa
E-iceblue support team
User avatar

Lisa.Li
 
Posts: 1261
Joined: Wed Apr 25, 2018 3:20 am

Wed Jun 07, 2023 2:14 pm

使用最新版本Spire.Doc V11.5.6.0 (使用NuGet安装的Spire.office V8.6.0) 检查文档中是否包含宏(文档中有录制的宏代码),但是IsContainMacro始终返回False,请问还有什么办法吗?
代码如下:
Spire.Doc.Document doc = new Spire.Doc.Document();
doc.LoadFromFileInReadMode(@"C:\Users\XXX\Desktop\ssss.docx", Spire.Doc.FileFormat.Docx);
var hasMacros = doc.IsContainMacro;

Sub 宏1()
'
' 宏1 宏
'
'
Selection.TypeText Text:="ssss"
End Sub

wsktflje
 
Posts: 1
Joined: Wed Jun 07, 2023 2:08 pm

Thu Jun 08, 2023 3:16 am

wsktflje wrote:使用最新版本Spire.Doc V11.5.6.0 (使用NuGet安装的Spire.office V8.6.0) 检查文档中是否包含宏(文档中有录制的宏代码),但是IsContainMacro始终返回False,请问还有什么办法吗?
代码如下:
Spire.Doc.Document doc = new Spire.Doc.Document();
doc.LoadFromFileInReadMode(@"C:\Users\XXX\Desktop\ssss.docx", Spire.Doc.FileFormat.Docx);
var hasMacros = doc.IsContainMacro;

Sub 宏1()
'
' 宏1 宏
'
'
Selection.TypeText Text:="ssss"
End Sub

您好,

感谢您的咨询。
通过您提供的信息,我模拟了一个word文档并做了测试,复现了您的问题。我已经在我们的Bug 跟踪系统中记录了这个问题,编号为“SPIREDOC-9512”。我们的开发回调查修复的,一旦此问题解决,我会及时告知你的。由此造成的不便深感抱歉。

Sincerely
Wenly
E-iceblue support team
User avatar

Wenly.Zhang
 
Posts: 149
Joined: Tue May 16, 2023 2:19 am

Return to Spire.Doc