Could someone nudge me in the right direction, please?
Regards
Roderick O'Regan
Sub Macro1()
ActiveWindow.Selection.SlideRange _
Shapes.AddPicture(FileName:= _
"C:\My Documents\My Pictures\Picture.jpg", _
LinkToFile:=msoFalse, SaveWithDocument:=msoTrue, _
Left:=206, Top:=73, Width:=309, Height:=395).Select
End Sub
This will, when run in edit mode, add the picture "Picture.jpg" to your
slide.
--
Bill Dilworth, Microsoft PPT MVP
===============
Please spend a few minutes checking vestprog2@
out www.pptfaq.com This link will yahoo.
answer most of our questions, before com
you think to ask them.
Change org to com to defuse anti-spam,
ant-virus, anti-nuisance misdirection.
.
.
"Roderick O'Regan" <ror...@businesstraining.co.uk.NOSPAM> wrote in message
news:uJHss16C...@tk2msftngp13.phx.gbl...
Sub Main()
'Declare a variable as a FileDialog object.
Dim fd As FileDialog
'Create a FileDialog object as a File Picker dialog box.
Set fd = Application.FileDialog(msoFileDialogFilePicker)
'Declare a variable to contain the path
Dim vrtSelectedItem As Variant
Dim FileName As String
'Use a With...End With block to reference the FileDialog object.
With fd
'Set the tile of the dialog box as well as the action button
.InitialFileName = "C:\"
.Title = "Insert Picture"
.ButtonName = "Insert"
.InitialView = msoFileDialogViewDetails
'Add a filter that includes GIF and JPEG images and make it the
first item in the list.
.Filters.Add "Images", "*.gif; *.jpg; *.jpeg,*.png,
*.eps,*.tif,*.tiff", 1
'Use the Show method to display the File Picker dialog box and
return the user's action.
'The user pressed the action button.
If .Show = -1 Then
'Step through each string in the FileDialogSelectedItems
collection.
For Each vrtSelectedItem In .SelectedItems
'vrtSelectedItem is a String that contains the path of each
selected item.
ActiveWindow.Selection.SlideRange.Shapes.AddPicture(vrtSelectedItem,
msoFalse, msoCTrue, 206, 206).Select
Next vrtSelectedItem
'The user pressed Cancel.
Else
End If
End With
'Set the object variable to Nothing.
Set fd = Nothing
End Sub
Works a treat!
"Bill Dilworth" <vest...@yahoo.org> wrote in message
news:eo%238dJ%23CEH...@TK2MSFTNGP11.phx.gbl...
Hello,
Although this can be done through VBA, perhaps you might want some future
version of PowerPoint to provide a solution or feature which accomplishes
the same task, without having to resort to VBA or add-ins?
If you (or anyone else reading this message) think that it's important that
PowerPoint provide this kind of functionality, don't forget to send your
feedback (in YOUR OWN WORDS, please) to Microsoft at:
http://register.microsoft.com/mswish/suggestion.asp
As with all product suggestions, it's important that you not just state
your wish but also WHY it is important to you that your product suggestion
be implemented by Microsoft. Microsoft receives thousands of product
suggestions every day and we read each one but, in any given product
development cycle, there are only sufficient resources to address the ones
that are most important to our customers so take the extra time to state
your case as clearly and completely as possible.
IMPORTANT: Each submission should be a single suggestion (not a list of
suggestions).
John Langhans
Microsoft Corporation
Supportability Program Manager
Microsoft Office PowerPoint for Windows
Microsoft Office Picture Manager for Windows
For FAQ's, highlights and top issues, visit the Microsoft PowerPoint
support center at: http://support.microsoft.com/default.aspx?pr=ppt
Search the Microsoft Knowledge Base at:
http://support.microsoft.com/default.aspx?pr=kbhowto
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of any included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm