Hello. Will you try this for me and see if you can figure it out
1. Create a Windows Application and on Form1 (with a webBroswer on it) page load put this:
private void Form1_Load(object sender, EventArgs e){
webBrowser1.Navigate(@"C:\Documents and Settings\blowe\My Documents\Visual Studio 2005\Projects\WordDocument1\WordDocument1\bin\Debug\WordDocument1.doc");}
2. Create a WordDocument Application and put this in the code:
private
void ThisDocument_Startup(object sender, System.EventArgs e){Word.
Application app = this.Application;Word.Range r = this.Range(ref missing, ref missing);
r.Text = "Hello";
app.DisplayStatusBar = true;}
3. Now run your Windows application and it should run fine. But my problem is it doesn't display the StatusBar. The bar that says "Page 1 Sec 1 blah blah...." Do you know what I mean
Your help would be SO appreciated! Thanks!

Please try this: view Word doc in webBrower
SocratesBrighton
Hi Brenda,
Now you're on the right track! The Actions pane is a great place to display information to the user. However, there is nothing special in VSTO to find the current page - that is all done through the object model, and those types of questions should be directed here: http://msdn.microsoft.com/newsgroups/default.aspx dg=microsoft.public.word.vba.general&lang=en&cr=US
However, since I know the answer, here's how you get the current page number...
// this line gets the 'real' page number:
int realPageNumber = (int)Application.Selection.get_Information(Microsoft.Office.Interop.Word.WdInformation.wdActiveEndPageNumber);
// this line gets the adjusted page number (i.e. if the user started
// numbering pages on the 5th page to account for a title page and
// table of contents)
int userPageNumber = (int)Application.Selection.get_Information(Microsoft.Office.Interop.Word.WdInformation.wdActiveEndAdjustedPageNumber);
// this line gets the total number of pages in the document
int totalPages = (int)Application.Selection.get_Information(Microsoft.Office.Interop.Word.WdInformation.wdNumberOfPagesInDocument);
Hope that helps! If you have more Object Model (OM) questions, please direct them to the link above.
Rufus
ijemiD
Hi Brenda,
The short answer to your question is, you can't show the Word status bar when it's hosted in Internet Explorer, whether you have customization behind the document or not.
To test this out, you can create a word .doc, go to Tools --> Options --> View and make sure "Status bar" is checked, and save it to your desktop. Then open Internet Explorer and drag the doc from the desktop onto IE's main window and choose "Open" from the dialog that appears. Notice that Word's status bar doesn't appear. So now, in IE, go to Tools --> Options --> View and notice that the checkbox for "Status Bar" is now disabled (you may wonder why the box is checked, but this just shows you the last saved setting for the option when it was set in Word).
So, it's really the functionality of Word inside Internet Explorer rather than a VSTO issue. If you want to pursue it further, I recommend asking over at the Word newsgroup, here: http://msdn.microsoft.com/newsgroups/default.aspx dg=microsoft.public.word.vba.general&lang=en&cr=US
Rufus
eggie5
Just so you know, here is the discussion continued in the Word forum:
http://msdn.microsoft.com/newsgroups/default.aspx dg=microsoft.public.word.vba.general&mid=29595b55-bc0d-48d8-86a2-b31dbecfcb93
Divya
So I think I'm going to need a work around for this. Is there a way to retrieve the current page section etc I did this:
lblParagraph.Text =
"Current # of paragraphs: " & CInt(Math.Ceiling((Me.ActiveWindow.Document.Paragraphs.Count / 2))).ToStringActionsPane.Controls.Add(lblParagraph)
So I will just display things that way. Is there a function in VSTO to find the cursor position
FYI...I am a newer programmer to VSTO.
Thanks for your help!