HighTechTalks DotNet Forums  

Prevent embedded Word instance resizing for invisible task pane

Dotnet Framework (Interop) microsoft.public.dotnet.framework.interop


Discuss Prevent embedded Word instance resizing for invisible task pane in the Dotnet Framework (Interop) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
craigeandrews@gmail.com
 
Posts: n/a

Default Prevent embedded Word instance resizing for invisible task pane - 07-02-2007 , 07:13 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


Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.