Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / March 2006

Tip: Looking for answers? Try searching our database.

Resizing a EPS figure

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
n o s p a m p l e a s e - 11 Mar 2006 05:45 GMT
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
Jezebel - 11 Mar 2006 06:25 GMT
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

>I am attempting to write a macro that does the following:
>
[quoted text clipped - 25 lines]
>    Selection.TypeText Text:=":"
> End Sub
n o s p a m p l e a s e - 11 Mar 2006 14:47 GMT
> 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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.