N
Nickolai Medveditskov
Hi,
I am hosting MS Word in my ActiveX written in C++ unmanaged code.
This ActiveX manipulates document content via Automation.
It inserts the OLE controls into document using the following code:
[pseudocode]
ActiveDocument.InlineShapes.AddOLEControl("MyWordWrapper.MyTextBox")
[/pseudocode]
When the Word's Macro Security is set to High everything is OK - the control
is inserted without any problems.
When the security level is set to Low, Word produces message box:
=======================
Can't exit design mode because Control 'MyTextBoxXXX' can not be created
=======================
where the "XXX" is some ordinal. Nevertheless the control is correctly inserted
with name "MyTextBoxYYY" where "YYY" is
an ordinal that's different from "XXX". At the moment of insertion NO other
controls of type "MyWordWrapper.MyTextBox" are present
in the document BUT the control with the same name ('MyTextBoxXXX') might
have existed in this document before.
My questions are:
1. How I can eliminate this warning in Low Security Mode?
NOTE: - I cannot change the Macro Security Level.
- I receive the Word document from third party and can manipulate it ONLY
via automation.
2. What's the cause of this warning?
Thanks.
Nickolai
I am hosting MS Word in my ActiveX written in C++ unmanaged code.
This ActiveX manipulates document content via Automation.
It inserts the OLE controls into document using the following code:
[pseudocode]
ActiveDocument.InlineShapes.AddOLEControl("MyWordWrapper.MyTextBox")
[/pseudocode]
When the Word's Macro Security is set to High everything is OK - the control
is inserted without any problems.
When the security level is set to Low, Word produces message box:
=======================
Can't exit design mode because Control 'MyTextBoxXXX' can not be created
=======================
where the "XXX" is some ordinal. Nevertheless the control is correctly inserted
with name "MyTextBoxYYY" where "YYY" is
an ordinal that's different from "XXX". At the moment of insertion NO other
controls of type "MyWordWrapper.MyTextBox" are present
in the document BUT the control with the same name ('MyTextBoxXXX') might
have existed in this document before.
My questions are:
1. How I can eliminate this warning in Low Security Mode?
NOTE: - I cannot change the Macro Security Level.
- I receive the Word document from third party and can manipulate it ONLY
via automation.
2. What's the cause of this warning?
Thanks.
Nickolai