Click to See Complete Forum and Search --> : Office.Word in C#


jhen095
January 28th, 2008, 03:14 PM
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

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

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.

dglienna
January 28th, 2008, 03:35 PM
Open it read only for the user, and keep the live version hidden

jhen095
January 28th, 2008, 04:50 PM
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?