Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Word
application.errors
conversions
docmanagement
drawing.graphics
formatting.longdocs
international
internet.assistant
mail
mailmerge.fields
menustoolbars
newusers
numbering
oleinterop
pagelayout
printingfonts
setup.networking
spelling.grammar
tables
vba.addins
vba.beginners
vba.customization
vba.general
vba.userforms
web.authoring
word6-7macros
word97vba
  
 
date: Thu, 29 May 2008 11:32:00 -0700,    group: microsoft.public.word.oleinterop        back       


How to go to a specified page of an open Word file?   
Hello, friends,

In our c#.net 2005 application, we use Interop.Word to open a Word .doc file 
like the follows:

Microsoft.Office.Interop.Word.Document doc = wordApp.Documents.Open(ref 
fileName, ref missing, ref readOnly, ref missing, ref missing, ref missing, 
ref missing, ref missing, ref missing, ref missing, ref missing, ref 
isVisible, ref missing, ref missing, ref missing);

This worked fine. Then we hope we can make the current page to a predefined 
page number, say page 11. How can we do this?

Thanks a lot for your help.
date: Thu, 29 May 2008 11:32:00 -0700   author:   Andrew

Re: How to go to a specified page of an open Word file?   
Insert a bookmark on that page and then use code to select the Range of the 
bookmark.

-- 
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"Andrew"  wrote in message 
news:784D4BA8-4111-4A94-9BD1-176DEB1074F3@microsoft.com...
> Hello, friends,
>
> In our c#.net 2005 application, we use Interop.Word to open a Word .doc 
> file
> like the follows:
>
> Microsoft.Office.Interop.Word.Document doc = wordApp.Documents.Open(ref
> fileName, ref missing, ref readOnly, ref missing, ref missing, ref 
> missing,
> ref missing, ref missing, ref missing, ref missing, ref missing, ref
> isVisible, ref missing, ref missing, ref missing);
>
> This worked fine. Then we hope we can make the current page to a 
> predefined
> page number, say page 11. How can we do this?
>
> Thanks a lot for your help.
>
date: Fri, 30 May 2008 10:47:07 +1000   author:   Doug Robbins - Word MVP

Re: How to go to a specified page of an open Word file?   
"Andrew"  wrote:
> Hello, friends,
>
> In our c#.net 2005 application, we use Interop.Word to open a Word .doc 
> file
> like the follows:
>
> Microsoft.Office.Interop.Word.Document doc = wordApp.Documents.Open(ref
> fileName, ref missing, ref readOnly, ref missing, ref missing, ref 
> missing,
> ref missing, ref missing, ref missing, ref missing, ref missing, ref
> isVisible, ref missing, ref missing, ref missing);
>
> This worked fine. Then we hope we can make the current page to a 
> predefined
> page number, say page 11. How can we do this?

Don't know about C# syntax, but you'll probably be able to adapt the VBA 
code:

Selection.GoTo What:=wdGoToPage,Which:=wdGotoAbsolute,Count:=11

Regards,
Klaus
date: Sun, 1 Jun 2008 18:58:08 +0200   author:   Klaus Linke

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us