You can
host multiple office component in a form
or you can open multiple office instance
in your internet explore with EDraw
Office Viewer Component version 5.
Note: you need set the Frame hook policy
as SetOnFirstOpen and Component
activation policy as
KeepUIActiveOnAppDeactive.
Frame hook policy
To correctly handle activation when the
host gains or loses foreground status,
the ActiveX control uses a frame hook.
By default, the hook is set when the
control is created. In some situations,
especially when the control is used from
a multi-threaded UI host or when the
control is nested in a container control
like a Tab page in a .NET WinForm
application, the parent of the control
at create time may not be the correct
window for the control to hook when it
is running. In these situations, you can
use the FrameHookPolicy property to
reset the hook at a more suitable time.
For example, if you build a .NET WinForm
solution, set the FrameHookPolicy
property to SetOnFirstOpen in the
Properties window.
Component activation policy
The sample control can support more than
one instance of itself in a given host
application. However, only one control
can be active at a given time. This is a
requirement of ActiveX Document hosting.
To handle multiple instances in a single
host, the control registers itself with
a component manager. This lets the
component manager keep track of the
active control. Use the ActivationPolicy
property to control how the embedded
object is handled during component
changes. The ActivationPolicy property
can be set to one or more of the bit
flags that are defined by the
ActivationPolicy enumeration.
You need
set it as follow:
param name=”ActivationPolicy” value=”1″
param name=”FrameHookPolicy” value=”1″
Or in your
custom user control, set the following
properties of the office viewer
component: Activationpolicy=4,
FrameHookPolicy=1.
But this leads to another problem: the
inner office application is reloaded
everytime the control is activated. So
if you wanna hide some of the toolbar
buttons, you have to use the code in the
activation blocks instead of the control
initialize statement.
