CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2008
    Posts
    20

    Post Office.Word in C#

    Hey,

    I've been doing alot of work with programmatically working with Microsoft Word to show a sample document which is manipulated by the user through external controls (lists and buttons and such on the form), the word document is embedded in the form also.

    Obviously since the document is manipulated externally I don't want the user to be able to change the word document shown directly.

    I have tried two different options, the first is
    Code:
    WinWordSample.Enabled = false;
    so that the user cannot click the word control, this is not ideal as if the document becomes too long then the user cant use the scroll to see the bottom.

    The other option was
    Code:
    WinWordSample.PrintPreview();
    This is perfect except it takes flaming ages to load each time a change is made (cant make a change without exiting print preview and then entering again.)

    Does anyone have any suggestions as to how i can disable editing of word yet keep the scroll bar??

    any help is appreciated, thanks in advace.
    (.NET Version 2.0.50727) VS2005

  2. #2
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: Office.Word in C#

    Open it read only for the user, and keep the live version hidden
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  3. #3
    Join Date
    Jan 2008
    Posts
    20

    Re: Office.Word in C#

    i just tried it.

    It opened the readOnly document, but you could still click in the control (the WinWordSample word document) and type stuff, it wouldn't save it but thats not the point.

    I would like it so the user cannot use the WinWordSample control (ie no typing) but can still use the scroll bar down the side.

    cheers

    ps. did u mean make the document readOnly by right clicking it in windows and changing its property to readOnly or did u mean to do this programmatically? would it be any different?
    (.NET Version 2.0.50727) VS2005

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured