Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Embed word docuemt to a .Net form

Status
Not open for further replies.

Kenny62

Programmer
Mar 3, 2004
54
GB
Hi - i've followed guidelines on HOWTO: Use the WebBrowser Control to Open an Office Document in Visual Basic .NET

Now i want the the docment to be displayed in Print layoutview mode, with no ruler and readonly.

I've got hold of the document object via the NavigateComplete2 event - i've got the objects Word.Document and Word.Application. I Need the properties or methods that control Print layoutview mode, ruler and readonly. Can someone please point me in the right direction.

Thanks for your help in advance. Ken
 
when you open your file set ReadOnly:=True

with your word application object

.PrintPreview = True
.ActiveWindow.ActivePane.DisplayRulers = False

Dale
 
Thanks for the suggestion Dale.

The .ActiveWindow.ActivePane.DisplayRulers = False , works

When i open the word document in the webbrowser control - i do something like:

AxWebBrowser.Navigate("c:\temp\myfile.doc")

I don't understand how you can set a readonly property when the file is being opened - please explain.

When i try to set .PrintPreview = True on the word application object i get runtime error as follows:
This command is not available.
Original Source::Microsoft Word
at Word.ApplicationClass.set_PrintPreview(Boolean prop)
Any ideas? I have ms word 2002 (10.2627.35-1 SP1 installed)

Ther are four little buttons to the left of the horizontal scrollbar. The third one along is 'Print layout view'. I want this display mode selected after the document has loaded. Any ideas?

Thanks for your help in advance, Ken
 
Ahh, you want the ASP forum. You might have a little more luck there.

But as far as opening, you probably want something like this:

AxWebBrowser.Navigate("c:\temp\myfile.doc", , True)

In Windows, ReadOnly is the 3rd parameter. You may have to play with that a bit.

In terms of PrintPreview, I'm not sure. I'm using Word 2003. It might not be available in 2002, or it may be called something else. Scroll through your properties & methods to see what you have available.

Dale
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top