You can host multiple office component in a form or you can open multiple office instance in your internet explore with Edraw Viewer Component version 7.
The new version 7 has no toolbar-locked issues with multiple instances of Word or excel opened in several tabs or even inside single form.
Note: you need set the Frame hook policy as SetOnFirstOpen and Component activation policy as KeepUIActiveOnAppDeactive in the previous version. But it doesn’t work for the IE7 or IE8.
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.
9 Responses to “Host multiple Excel and Word components in a form”
Leave a Reply
You must be logged in to post a comment.
August 26th, 2007 at 7:26 am
You need set it as follow:
param name=”ActivationPolicy” value=”1″
param name=”FrameHookPolicy” value=”1″
August 27th, 2007 at 11:07 am
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.
November 7th, 2007 at 4:43 am
Hi we are evaluating the use of your active-x control particularly playing powerpoint files in our digital signage application.
Our requirements needs us to load the files in realtime. However the call to _axOfficeViewer.SlideShowOpenAndPlay() takes roughly 7 seconds to complete.
Is there a method that allows us to load the powerpoint container beforehand (during program startup) and then set the powerpoint file to run at a later stage?
Any help or pointers would be greatly appreciated.
May 16th, 2008 at 7:22 pm
I’m using Infragistics’ ultraWinTab and placing the viewer control there. I suppress the menu bar and tool bar programmatically with:
axOfficeViewer1.Menubar = false;
axOfficeViewer1.Titlebar = false;
axOfficeViewer1.Toolbars = false;
When I double click the tab to open the Word doc in a separate floating panel, I again suppress them with the same code, both in the new window and again on the tab by referring back to the original instance.
The instance on the tab creates space above the document and acts as though it’s going to show the menu and tool bars. However, they never appear and that space is corrupted with partial drawing of the window behind and any window you drag across that tabbed area.
Note that everything works fine if I don’t suppress the menu and tool bars.
Any suggestions? Thanks in advance.
May 27th, 2008 at 3:30 pm
Hi,
I’m evaluating the Office Viewer Component to use in a web application. The requirement is that the user will be able to open Microsoft Office files – each in a different tab within the application. The problem is that when switching from one tab to another and going back to the previous tab, the control is empty, does not show the document anymore.
I set the parameters:
or
but without any success
May 28th, 2008 at 9:10 am
I meant
param name=”ActivationPolicy” value=”1″
param name=”FrameHookPolicy” value=”1″
or
param name=”ActivationPolicy” value=”4″
param name=”FrameHookPolicy” value=”1″
July 7th, 2008 at 1:41 pm
The component runs as exclusive mode in default. So you need close other excel instance before you use the component.
The component has two properties. Set them in your initial function if you want open multiple instances.
axOfficeViewer.ActivationPolicy = OfficeViewer.ActivationPolicy.KeepUIActiveOnAppDeactive;
axOfficeViewer.FrameHookPolicy = OfficeViewer.FrameHookPolicy.SetOnFirstOpen;
Please use the NotifyCtrlRead event and have a try.
function OA1_NotifyCtrlReady() {
document.form1.EDrawComponent.ActivationPolicy = 4
document.form1.EDrawComponent.FrameHookPolicy = 1
}
<SCRIPT LANGUAGE=javascript FOR=OA1 EVENT=NotifyCtrlReady>
<!–
OA1_NotifyCtrlReady();
//–>
</SCRIPT>
November 10th, 2009 at 8:24 am
For IE8 and the Word 2003, the toolbar in MS Word will disable when you open a word from the desktop. There are good methods to solve the issue. The IE7 hasn’t the issue. IE8 and the Office 2007 have not the bug too.
June 28th, 2010 at 11:24 am
Inthe Edraw Office Viewer Component 7.x, the mulitiple instances issue was solved through. Now with the new version, you can open multiple word or excel intance in a form. You can also open mulitple IE tabe to open word at the same tiem. If you launch the Word or Excel outside of the component, it is no problem too. The new version needs not set the ActivationPolicy and FrameHookPolicy value.