OleContainer - show another page of Word document

J

JT

I'm using OleContainer to show .doc files in my app. I'm using only preview
mode (no menu & toolbars). Problem is that I can show only first page.
Is there any way how to tell OleContainer which page it should show?

I have similar problem with Excel, I can show only first Worksheet
 
C

Cindy M -WordMVP-

Hi =?Utf-8?B?SlQ=?=,
I'm using OleContainer to show .doc files in my app. I'm using only preview
mode (no menu & toolbars). Problem is that I can show only first page.
Is there any way how to tell OleContainer which page it should show?
Nope. Other than actually moving the text you want to display to the top of
the document.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 
J

JT

Hi,
Nope. Other than actually moving the text you want to display to the top of
the document.
I was afraid of that.

When user edit document in OleContainer and stop editing on second page,
then second page is showed in preview. Is it at least possible to simulate
this?

Or generally, is there a way how to get WordDocument from OleContainer?
 
C

Cindy M -WordMVP-

Hi =?Utf-8?B?SlQ=?=,
I was afraid of that.

When user edit document in OleContainer and stop editing on second page,
then second page is showed in preview. Is it at least possible to simulate
this?

Or generally, is there a way how to get WordDocument from OleContainer?
Hmmm. The only OLEContainer I've ever worked with has been embedded OLE objects
in an Office application. From these, yes, I can get the document or the
workbook and automate it. I can show you pseudo-VBA code for this, but I don't
know how well it will "translate" into your interface (see below).

Generally, however, I'd say yes, you should be able to address Word.Document in
the OLEContainer, once you determine the correct syntax for the environment in
which you're working. And then I'd try something like the following to emulate
the user selecting text on a particular page:

Set rng = wdDoc.Range.GoTo What:=wdGoToPage, Which:=wdGoToAbsolute, Count:=2
rng.Select

Getting a Word.document from an embedded OLE object in Office:

Dim of As Word.OLEFormat
Dim doc As Word.Document
Dim oDoc As Word.Document

Set doc = ActiveDocument
Set of = doc.InlineShapes(1).OLEFormat
of.DoVerb wdOLEVerbPrimary ' wdOLEVerbInPlaceActivate
Set oDoc = of.Object
Debug.Print oDoc.Name

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top