[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.interop

Prevent embedded Word instance resizing for invisible task pane

craigeandrews

7/2/2007 11:13:00 AM

Hi all,

I am using a slightly modified version of DsoFramer to embed a Word
document into a Windows Forms application, but have a strange problem
when trying to protect the document from user input. If I use the
Document.Protect() method to set the document as read only, then press
a key as if to edit it, the document window resizes within the frame
as if a task pane was opening beside it. This leaves a large (206px)
gap on the right hand side of the document with nothing in it except
rendering artefacts because it is never cleared.

I know it is possible to hide the task panes, but there is no specific
event that tells me when one is opened that I can respond to. There
seem to be a few different things that cause the window to resize in
preparation for a task pane, but I would like to completely prevent
this from happening at all rather than having to try and hide the task
pane section whenever it tries to appear.

Is there a way I can prevent this behaviour, either through interop
calls or some other way? If not, is there a way I can handle events
that fire when task panes open so I can close them again?

Of course, failing that, I am looking for a way of viewing a Word
document from within a Windows Forms app in a completely read-only
way. It feels a bit like using an embedded Word instance may be the
wrong way about it - I seem to spend more time turning functionality
off than anything else.

Any help is appreciated,

Thanks,

Craig