Oh yeah, there we go. I don't know a thing about PowerPoint but I'm pretty handy with franken-coding.
The hard part is figuring out the names of everything. I worked on my original idea until it finally paid off:
Sub ExportSlidesToIndividualPDF()
Dim oPPT As Presentation: Set oPPT = ActivePresentation
Dim sExt As String: sExt = ".pdf"
Dim oSlide As Slide
'Set reference to MS Outlook 14.0 Library
Dim olApp As Outlook.Application: Set olApp = New Outlook.Application
Dim olMail As Outlook.MailItem: Set olMail = olApp.CreateItem(olMailItem)
'Set reference to MS Scripting Runtime
Dim objDict As Object: Set objDict = CreateObject("Scripting.dictionary")
For i = 1 To oPPT.Slides.Count
sPath = oPPT.FullName & oPPT.Slides(i).Shapes(1).TextFrame.TextRange.Text
oPPT.Slides(i).Select
strSaveName = Replace(sPath, ".ppt", "") & "_Slide_" & Format(i, "000") & sExt
oPPT.ExportAsFixedFormat _
Path:=strSaveName, _
FixedFormatType:=ppFixedFormatTypePDF, _
RangeType:=ppPrintSelection
objDict.Add i, strSaveName
Next
With olMail
.To = "wow_this@was_hard.com" 'You can also add in .CC if you want
.Subject = "Awesome"
With .Attachments
For c = 0 To objDict.Count
.Add objDict.Items()(c)
Next
End With
.Display 'Change .Display to .Send to send instantly without prompting you
End With
Set oPPT = Nothing
Set olMail = Nothing
Set olApp = Nothing
Set objDict = Nothing
End Sub
This will save each Slide as a single PDF, with the slide number, and save the name of each to a little invisible floaty index while it goes.
Then when it creates a new mail item, it goes back to the "scripting dictionary" thingy and pulls all the file names it stored from before and attaches them.
I just taught myself Scription.Dictionary on Friday, glad to see I already found a use for it.
Bookmarks