Resizing a EPS figure

  • Thread starter n o s p a m p l e a s e
  • Start date
N

n o s p a m p l e a s e

I am attempting to write a macro that does the following:

1. Inserts a picture
2. Resizes it to Height = 601.5 and Width = 425.2
3. Inserts a caption Figure at the bottom of the picture

I tried to record a macro as below. I could succeed in recording a
macro that does 1 and 3 but I could not do 2.

How do I resize the picture?

Thanx
NSP


Sub InsertPic()
'
' InsertPic Macro
' Macro recorded 3/10/2006 by ..
'
Selection.InlineShapes.AddPicture FileName:= _
"C:\SIMPOW\MultiInfeed\NF10fd_No_Pump\With SVC\List
Series-2\Block of 2 pole GUG1 Q 300 MVAR PFC\plot_nf10fd_sheet_1.eps" _
, LinkToFile:=False, SaveWithDocument:=True
Selection.TypeParagraph
Selection.InsertCaption Label:="Figure", TitleAutoText:="",
Title:="", _
Position:=wdCaptionPositionBelow
Selection.TypeText Text:=":"
End Sub
 
J

Jezebel

The macro recorder is only a tool good for giving you an idea of what the
macro should contain. It's not useful for actually creating serious macros
(as you've discovered!) ...

With Selection.InlineShapes.AddPicture(FileName:="C:\SIMPOW\....")
.Width = 425.2
.Height = 601.5
.Range.InsertCaption Label:=wdCaptionFigure,
Position:=wdCaptionPositionBelow
End With




"n o s p a m p l e a s e"
 
N

n o s p a m p l e a s e

Jezebel said:
With Selection.InlineShapes.AddPicture(FileName:="C:\SIMPOW\....")
.Width = 425.2
.Height = 601.5
.Range.InsertCaption Label:=wdCaptionFigure,
Position:=wdCaptionPositionBelow
End With

Thank you. I attempted to generalise your code for two figures as
below:


With Selection.InlineShapes.AddPicture(FileName:="C:\SIMPOW\Fig1.eps")
.Width = 425.2
.Height = 601.5
.Range.InsertCaption Label:=wdCaptionFigure,
Position:=wdCaptionPositionBelow
End With
With Selection.InlineShapes.AddPicture(FileName:="C:\SIMPOW\Fig2.eps")
.Width = 425.2
.Height = 601.5
.Range.InsertCaption Label:=wdCaptionFigure,
Position:=wdCaptionPositionBelow
End With

It does insert two figures and resizes them but puts all captions for
both figures in the end and NOT after each figure.

Any suggestions! Thank you/NSP
 

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