modify Code to have Prompt instead of actual jpg

C

Corey

How can i modify the below line of code to give me a FileDialog box to prompt the user for a
selection of a jpg if it is not known ?

Sub AddPicture()
' Macro recorded 30/01/2007 by Corey
ActiveWindow.Selection.SlideRange.Shapes.AddPicture(FileName:="\\Stserver\IMG_0034.jpg",
LinkToFile:=msoFalse, SaveWithDocument:=msoTrue, Left:=-183, Top:=49, Width:=909,
Height:=682).Select
ActiveWindow.Selection.SlideRange.Shapes.AddPicture
With ActiveWindow.Selection.ShapeRange
.Fill.Transparency = 0#
.Height = 226.75
.Width = 302.38
End With
ActiveWindow.Selection.ShapeRange.IncrementLeft 295
ActiveWindow.Selection.ShapeRange.IncrementTop 235
With ActiveWindow.Selection.ShapeRange
.Fill.Transparency = 0#
.Line.Weight = 1.25
.Line.Style = msoLineThinThin
.Line.Visible = msoTrue
.Line.ForeColor.RGB = RGB(255, 51, 0)
.Line.BackColor.RGB = RGB(255, 255, 255)
End With
End Sub


Corey....
 
S

Steve Rindsberg

How can i modify the below line of code to give me a FileDialog box to prompt the user for a
selection of a jpg if it is not known ?

Have a look here:

http://vbnet.mvps.org/

and search for "common dialog"

It's a bit tricky if you've never used it before, but the same code will work in any version of
PowerPoint (or other VBA-enabled Office apps, or VB or ....)
 

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