Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I format a picture?

Status
Not open for further replies.

JanTore

Technical User
Jun 9, 2001
34
NO
How can I, with code, select a newly inserted picture.

I've used this to insert the picture

Private Sub CommandButton1_Click()
Selection.EndKey Unit:=wdStory
Dialogs(wdDialogInsertPicture).Show

But how can i select it to use the wdDialogFormatPicture, or is there another way to format the pictures to a specified height and width?

Jan Tore
 
Here's an example:

Code:
Private Sub CommandButton1_Click()
   Selection.EndKey Unit:=wdStory
   Dialogs(wdDialogInsertPicture).Show
   Selection.MoveLeft Unit:=wdCharacter, count:=1, Extend:=wdExtend
   Selection.InlineShapes(1).Height = 250
   Selection.InlineShapes(1).Width = 312
End Sub

Or:

Code:
Private Sub CommandButton1_Click()
   Selection.EndKey Unit:=wdStory
   Dialogs(wdDialogInsertPicture).Show
   Selection.MoveLeft Unit:=wdCharacter, count:=1, Extend:=wdExtend
   Dialogs(wdDialogFormatPicture).Show
End Sub


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top