![]() |
#1
|
|||
|
|||
![]()
Hi,
I have some code which opens a file called "Presentation.pptx" then copies its slides onto an active ppt file. Code:
Sub main() Dim objPresentation As Presentation Dim i As Integer 'open the target presentation Set objPresentation = Presentations.Open("C:\Presentation.pptx") For i = 1 To objPresentation.Slides.Count objPresentation.Slides.Item(i).Copy Presentations.Item(1).Slides.Paste Next i objPresentation.Close End Sub For example file could be called PresentationB.pptx and still be opened. Reason for this is that file name changes every week (but always contains word Presentation) so if we put in macro a fixed file name the macro may not be able to find it. Thanks, Nic ![]() ![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
jeffreybrown | Word VBA | 2 | 05-01-2016 06:05 PM |
Export calendar events from multiple calendars with specific title | rasmus | Outlook | 0 | 02-06-2015 01:58 AM |
![]() |
danielle | Word | 4 | 12-03-2014 07:47 AM |
![]() |
pemartins | Excel | 16 | 02-24-2014 11:39 PM |
![]() |
ingmar.s | Word | 3 | 10-08-2009 10:23 AM |