Insert Pic Which User Chooses into Comment



I have this code...but I need to edit this code so the Insert Picture
Dialog box comes up and the user finds the picture...not how it
currently reads...this would automatically put a picture in without a
users choice....

Sub Macro1()
' Macro1 Macro
' Macro recorded 4/26/2007

Range("O3").Comment.Visible = False
Range("O3").Comment.Text Text:="meps2_spokane:" & Chr(10) & ""
Selection.ShapeRange.Line.Weight = 0.75
Selection.ShapeRange.Line.DashStyle = msoLineSolid
Selection.ShapeRange.Line.Style = msoLineSingle
Selection.ShapeRange.Line.Transparency = 0#
Selection.ShapeRange.Line.Visible = msoTrue
Selection.ShapeRange.Line.ForeColor.RGB = RGB(0, 0, 0)
Selection.ShapeRange.Line.BackColor.RGB = RGB(255, 255, 255)
Selection.ShapeRange.Fill.Visible = msoTrue
Selection.ShapeRange.Fill.ForeColor.RGB = RGB(255, 255, 255)
Selection.ShapeRange.Fill.BackColor.SchemeColor = 80
Selection.ShapeRange.Fill.Transparency = 0#
Selection.ShapeRange.Fill.UserPicture "C:\Galleries\Main Gallery
\Pict0225.JPG" *****Here is where I need the user to choose, not
this pic????********
Selection.ShapeRange.ScaleWidth 0.29, msoFalse,
Selection.ShapeRange.ScaleHeight 0.47, msoFalse,
End Sub

Any help is appreciated, thank you.


fname = Application.GetOpenFilename()
Selection.ShapeRange.Fill.UserPicture fName

see help on GetOpenFilename for addtional arguments
also you can add some if statements to test what the user has chosen before
you try to use it with the UserPicture command.

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