Group and rotate or flip multiple objects using Publisher 2003

R

ronh

Hi all - this thread moved over from MS publisher public at suggestion
of Ed.
I'm using a template regularly to place pictures and overlaid text
boxes on an A3 document, which will be folded to create an A4
leaflet. The pictures and text on the front page is therefore 180
degrees rotated so that it looks correct when folded - no problem so
far.

Is this a tent card style leaflet? Otherwise, I can't see why you need
to rotate the objects at all...
I would love a macro which would enable me to do this in one step (
rotate all elements and save the file as a pdf) I don't know much
about the macro editor in Publisher and I cannot find the command
which enables me to group elements.

You might want to come over to the
microsoft.public.publisher.programming group, where discussions about
programming in Publisher are on-topic.

The Group method is a member of the ShapeRange object, so would be
accessed by:
[A page object].Shapes.Range.Group

Note that simply grouping and rotating will not preserve your layout
properly - the distances from the top and left will become the
distances
from the bottom and right respectively. You can either do the math to
work out what the new top and left should be, or (if no objects spill
off the edge of the page) create a rectangle the size of the page,
group
everything to it, rotate the group, ungroup, and delete the rectangle.

--
Ed Bennett - MVP Microsoft Publisher
http://ed.mvps.org

Hi Ed,

yes it is a tent format as the inner 2 pages which have text are read
in portrait mode from the top to the bottom of the A3 page. The outer
two pages are laid out to be viewed in landscape mode.
I should have said FLIP rather than rotate. I can figure out how to
group "objects" like shapes etc. but when I try to include a picture I
come unstuck. Any further guidance or alternative solutions would be
great. Thankyou

Ron
 
E

Ed Bennett

ronh said:
I should have said FLIP rather than rotate.

No, rotate is correct. Flip would create a mirror image.
I can figure out how to group "objects" like shapes etc. but when I
try to include a picture I come unstuck. Any further guidance or
alternative solutions would be great.

Everything you can put on a page in Publisher is a "Shape". Text boxes,
AutoShapes, Pictures, OLE Objects, groups... all are represented in the
object model as a Shape object, a member of the Shapes collection. To
group all members of a Shape collection, you can use [Shape
Collection].Range.Group. To group a selection, you can use
[Document].Selection.ShapeRange.Group. To group all objects on a page,
use the Shapes collection of that page, i.e. [Page
Object].Shapes.Range.Group.
 
R

ronh

Hi all - this thread moved over from MS publisher public at suggestion
of Ed.
I'm using a template regularly to place pictures and overlaid text
boxes on an A3 document, which will be folded to create an A4
leaflet. The pictures and text on the front page is therefore 180
degrees rotated so that it looks correct when folded - no problem so
far.

Is this a tent card style leaflet? Otherwise, I can't see why you need
to rotate the objects at all...
I would love a macro which would enable me to do this in one step (
rotate all elements and save the file as a pdf) I don't know much
about the macro editor in Publisher and I cannot find the command
which enables me to group elements.

You might want to come over to the
microsoft.public.publisher.programming group, where discussions about
programming in Publisher are on-topic.

The Group method is a member of the ShapeRange object, so would be
accessed by:
[A page object].Shapes.Range.Group

Note that simply grouping and rotating will not preserve your layout
properly - the distances from the top and left will become the
distances
from the bottom and right respectively. You can either do the math to
work out what the new top and left should be, or (if no objects spill
off the edge of the page) create a rectangle the size of the page,
group
everything to it, rotate the group, ungroup, and delete the rectangle.

--
Ed Bennett - MVP Microsoft Publisherhttp://ed.mvps.org

Hi Ed,

yes it is a tent format as the inner 2 pages which have text are read
in portrait mode from the top to the bottom of the A3 page. The outer
two pages are laid out to be viewed in landscape mode.
I should have said FLIP rather than rotate. I can figure out how to
group "objects" like shapes etc. but when I try to include a picture I
come unstuck. Any further guidance or alternative solutions would be
great. Thankyou

Ron

Thanks for taking so much time with a newbie on this. I'm trying to
understand your instructions and using it in conjunction with the
Macro recorder in Word. I understand there will be some differences
but in Word I get something like this_
Sub Macro6()
'
' Macro6 Macro
' Macro recorded 6/9/2008 by Ron
'
ActiveDocument.Shapes("Rectangle 2").Select
ActiveDocument.Shapes.Range(Array("Rectangle 2", "Oval 3")).Select
Selection.ShapeRange.Group.Select
Selection.ShapeRange.IncrementRotation -90#
Selection.ShapeRange.IncrementRotation -90#
End Sub

where each hape is selected and then grouped and rotated.
What I cannot understand in Publisher is how do I get the names (or
identities) of each of the shapes.
I tried without any names and nothing happened.

Thanks Ron
 
E

Ed Bennett

ronh said:
What I cannot understand in Publisher is how do I get the names (or
identities) of each of the shapes.
I tried without any names and nothing happened.

You can't. You need to follow the instructions in my previous post to
group ALL the objects on the page.

Use ThisDocument to refer to the document in which the macro is running.
ThisDocument has a Pages property, which returns a Pages collection. The
Pages collection contains a Page object for each page in the
publication. These can be referenced by index, e.g.
ThisDocument.Pages(1) will return the first page, etc.

Thus to group all the objects on page 4, you use
ThisDocument.Pages(4).Shapes.Range.Group

This returns the new group in a Shape object. This can then be rotated
and ungrouped again. You can use a With block for this:

With ThisDocument.Pages(4).Shapes.Range.Group
.Rotation = 180
.Ungroup
End With
 
R

ronh

You can't. You need to follow the instructions in my previous post to
group ALL the objects on the page.

Use ThisDocument to refer to the document in which the macro is running.
ThisDocument has a Pages property, which returns a Pages collection. The
Pages collection contains a Page object for each page in the
publication. These can be referenced by index, e.g.
ThisDocument.Pages(1) will return the first page, etc.

Thus to group all the objects on page 4, you use
ThisDocument.Pages(4).Shapes.Range.Group

This returns the new group in a Shape object. This can then be rotated
and ungrouped again. You can use a With block for this:

With ThisDocument.Pages(4).Shapes.Range.Group
.Rotation = 180
.Ungroup
End With

Thanks Ed,

I understand now how that works, thankyou - however this moves or
rotates ALL elements on the page. Since this is an A3 sheet which is
subsequently folded I only need to rotate those elements on half of
the page. I assume this is not possible using this technique. Do you
have any alternative ideas please.

Ron.
 
E

Ed Bennett

ronh said:
I understand now how that works, thankyou - however this moves or
rotates ALL elements on the page. Since this is an A3 sheet which is
subsequently folded I only need to rotate those elements on half of
the page. I assume this is not possible using this technique. Do you
have any alternative ideas please.

Ah, I assumed you were using a Tend Card layout.

Suggestion: Use a tent card layout :eek:)
 

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