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