> All I want to do is to use Shapes.AddTextBox() to add a text to the center
> of the view of the active document. Note that it is not the center of page.
> It is the center of the view so that user can see it without scrolling.
I can't bring Mohammed to the mountain, but I can bring the mountain to
Mohammed - create the shape anywhere (e.g. middle of the page; storing a
reference to it in a variable) and then use (Document
object).ActiveView.ScrollShapeIntoView ShapeObject
> Basically, all commands from Publisher menu does that.
This is because all commands from the Publisher menus put the shape
where the user drags, and the user can't drag outside the view of the
active document! Since VBA is controlled by the programmer rather than
the user, it puts the shape where the coder specifies with co-ordinates
- not limited to the active view of the active document.

Signature
Ed Bennett - MVP Microsoft Publisher
http://ed.mvps.org
Yang Lu - 22 Apr 2008 17:29 GMT
Thank Ed.
ScrollShapeIntoView() is actually the method I am using now. But it zooms in
the shape, which is not what I want. The real code I am using is something
like:
oldZoom = ActiveView.Zoom; // save zoom
doc.ScrollShapeIntoView(shp);
ActiveView.Zoom = oldZoom; // restore zoom
Now, the problem becomes the view flashes because zoom in and out. I also
tried application.ScreenUpdating = false;
but it does not prevent the flashing.
if there is a way we can calculate the scroll position of the view, it would
be perfect and I can put the shape directly in the center of the view.

Signature
Thanks,
Yang Lu
MCAD, MCP.
> > All I want to do is to use Shapes.AddTextBox() to add a text to the center
> > of the view of the active document. Note that it is not the center of page.
[quoted text clipped - 12 lines]
> the user, it puts the shape where the coder specifies with co-ordinates
> - not limited to the active view of the active document.