Graphics

A

aehan

Does anyone know how to program Word to scale graphics automatically, eg 50%,
25% and so on. I tried recording it but it didn't work, it only recorded the
position of the graphic on the page rather than rescaling it. I need to have
a variety of rescaling options for a logo. Any help would be gratefully
received and appreciated. I've searched through help sites and can't find
anything on my own, but I have limited knowledge of where to find answers.

Many thanks
Aehan
 
J

Jean-Guy Marcil

aehan was telling us:
aehan nous racontait que :
Does anyone know how to program Word to scale graphics automatically,
eg 50%, 25% and so on. I tried recording it but it didn't work, it
only recorded the position of the graphic on the page rather than
rescaling it. I need to have a variety of rescaling options for a
logo. Any help would be gratefully received and appreciated. I've
searched through help sites and can't find anything on my own, but I
have limited knowledge of where to find answers.

What do you mean by Automatically?
How can the logo be rescaled to either 25% or 50% automatically?

Do you mean that after the logo has been inserted, the user will select it,
and then click on the appropriate % button to rescale it?
What Word version?

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 
A

aehan

What I would like to do is to allow a user to select a graphic such as a
logo, click on a toolbar button which is based on a macro and choose a
re-scaling option, eg 50%, 25% and so on. I've worked around it a bit by
using code that allows the user to rescale a named picture, however each time
a picture (logo) is inserted, Word gives it a new name, so that one isn't as
good as I had thought. The code I am using is:

Sub ScaleDown_BlackOnWhite()

Set myDocument = ActiveDocument

For Each s In myDocument.Shapes

If s.Name = "BlackOnWhite" Then

Select Case s.Type

Case msoEmbeddedOLEObject, msoLinkedOLEObject, _
msoOLEControlObject, msoLinkedPicture, msoPicture

s.ScaleHeight 0.5, True
s.ScaleWidth 0.5, True

Case Else

s.ScaleHeight 0.5, False
s.ScaleWidth 0.5, False

End Select

End If

Next

End Sub

What I'd like it to do is rescale the selected object. Any ideas?

Many thanks
Aehan
 
A

aehan

Sorry, forgot to say Word 2002.

Jean-Guy Marcil said:
aehan was telling us:
aehan nous racontait que :


What do you mean by Automatically?
How can the logo be rescaled to either 25% or 50% automatically?

Do you mean that after the logo has been inserted, the user will select it,
and then click on the appropriate % button to rescale it?
What Word version?

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 
J

Jean-Guy Marcil

aehan was telling us:
aehan nous racontait que :
What I would like to do is to allow a user to select a graphic such
as a logo, click on a toolbar button which is based on a macro and
choose a re-scaling option, eg 50%, 25% and so on. I've worked
around it a bit by using code that allows the user to rescale a named
picture, however each time a picture (logo) is inserted, Word gives
it a new name, so that one isn't as good as I had thought. The code
I am using is:

You have to check whether the selection contains a picture, and if it does,
you have to check if it is inline or floating because the inline pictures
will need the scale properties, whereas the floating ones will need the
scale methods. Try this code:

With Selection
Select Case .Type
Case 7 'Inline shape
.InlineShapes(1).ScaleHeight = 50
.InlineShapes(1).ScaleWidth = 50

Case 8 'Floating picture
.ShapeRange(1).ScaleHeight 0.5, True
.ShapeRange(1).ScaleWidth 0.5, True

Case Else
MsgBox "The current selection is not a picture." _
& vbCrLf & "Make sure you select only the picture itself.",
_
vbExclamation, "Error"
End Select
End With



--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 

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