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 / General PowerPoint Questions / January 2007

Tip: Looking for answers? Try searching our database.

modify Code to have Prompt instead of actual jpg

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Corey - 30 Jan 2007 05:00 GMT
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....
Shyam Pillai - 30 Jan 2007 05:21 GMT
You haven't mentioned which version of PowerPoint.

Regards,
Shyam Pillai

Animation Carbon - http://www.animationcarbon.com

> How can i modify the below line of code to give me a FileDialog box to
> prompt the user for a
[quoted text clipped - 25 lines]
>
> Corey....
Steve Rindsberg - 30 Jan 2007 16:57 GMT
> 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 ....)

> Sub AddPicture()
> ' Macro recorded 30/01/2007 by Corey
[quoted text clipped - 20 lines]
>
> Corey....

-----------------------------------------
Steve Rindsberg, PPT MVP
PPT FAQ:  www.pptfaq.com
PPTools:  www.pptools.com
================================================
 
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.