How do I place shapes on proper pages?

C

Chirag

Hi,

I want to place shapes on appropriate pages through code. For instance, when
a document has two pages, I want a rectangle somewhere on page 1 and an oval
on page 2. I tried to record a macro by doing this with a new document:
1. "Insert" | "Break..." menu item.
2. Select "Page break".
3. Click OK.
4. On page 1, create a rectangle.
5. On page 2, create an oval.

This generated the following macro:
Sub Macro1()
'
' Macro1 Macro
' Macro recorded 7/17/2003 by Chirag Dalal
'
Selection.InsertBreak Type:=wdPageBreak
ActiveWindow.ActivePane.LargeScroll Down:=-2
ActiveDocument.Shapes.AddShape(msoShapeRectangle, 189#, 108#, 162#, _
117#).Select
ActiveWindow.ActivePane.LargeScroll Down:=2
ActiveDocument.Shapes.AddShape(msoShapeOval, 198#, 135#, 234#, _
153#).Select
End Sub

Running the same macro again on a new document doesn't produce the same
results. I get both the shapes on the same page. How do I place the shapes
if I know the page number and the coordinates of the shape?

- Chirag
 

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