+ Reply to Thread
Results 1 to 10 of 10

Attaching PDFs from PowerPoint and Email

  1. #1
    Registered User
    Join Date
    05-14-2013
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2007
    Posts
    92

    Attaching PDFs from PowerPoint and Email

    Im using this code, but not sure where to add in code to attach to an email and display. Anyone can help?

    Sub ExportSlidesToIndividualPDF()
    Dim oPPT As Presentation, oSlide As Slide
    Dim sPath As String, sExt As String

    Set oPPT = ActivePresentation
    sPath = oPPT.FullName & "_Slide_"
    sExt = ".pdf"

    For Each oSlide In oPPT.Slides
    i = oSlide.SlideNumber
    oSlide.Select
    oPPT.ExportAsFixedFormat _
    Path:=sPath & i & sExt, _
    FixedFormatType:=ppFixedFormatTypePDF, _
    RangeType:=ppPrintSelection
    Next
    Set oPPT = Nothing
    End Sub

  2. #2
    Registered User
    Join Date
    05-14-2013
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2007
    Posts
    92

    Re: Attaching PDFs from PowerPoint and Email

    Anyone? Any thing?

  3. #3
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Attaching PDFs from PowerPoint and Email

    Do you want to send them all in a single email, together?

    If so, I'd probably add each name created to a Scripting.Dictionary, and after all were made would then create an outlook mail item and attach each by then referring to the index of name in the dictionary. Is this what you need?
    Make Mom proud: Add to my reputation if I helped out!

    Make the Moderators happy: Mark the Thread as Solved if your question was answered!

  4. #4
    Registered User
    Join Date
    05-14-2013
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2007
    Posts
    92

    Re: Attaching PDFs from PowerPoint and Email

    After some consideration, I just need to attach the power point to an email, what would be the easiest code for that (not separating into individual PDFs)?

  5. #5
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Attaching PDFs from PowerPoint and Email

    Like this?

    Please Login or Register  to view this content.

  6. #6
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Attaching PDFs from PowerPoint and Email

    If you still want to export as a single PDF, this might work for you as well:

    Please Login or Register  to view this content.

  7. #7
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Attaching PDFs from PowerPoint and Email

    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:

    Please Login or Register  to view this content.

    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.

  8. #8
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Attaching PDFs from PowerPoint and Email

    For c = 0 To objDict.Count-1

    Maybe

  9. #9
    Registered User
    Join Date
    05-14-2013
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2007
    Posts
    92

    Re: Attaching PDFs from PowerPoint and Email

    Im trying to use the above, but its throwing an error on the Dim olApp As Outlook.Application

  10. #10
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Attaching PDFs from PowerPoint and Email

    You have to set the references as indicated by the comments.
    You need to go to Tools->References and check the boxes for Microsoft Outlook and Microsoft Scripting Runtime.

    And I confirmed my suspicions with regards to solving the runtime error, the 'For c = 0 to ...' needs a -1 at the end.

    Please Login or Register  to view this content.
    Last edited by daffodil11; 07-21-2015 at 09:12 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. export to pdf not attaching to the email
    By dantray02 in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 01-30-2014, 01:23 PM
  2. [SOLVED] Attaching Picture to Email
    By Janie in forum Outlook Formatting & Functions
    Replies: 4
    Last Post: 07-30-2013, 04:23 PM
  3. [SOLVED] Attaching PDFs in a folder to an email.
    By yeahyeahyeah in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-02-2012, 06:02 PM
  4. Attaching files to an email
    By damage in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-12-2011, 01:14 PM
  5. Macro. compiling email, attaching 1x sheet + 1x powerpoint file.
    By rain4u in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-28-2011, 02:24 PM
  6. [SOLVED] Attaching to an email corrupts workbook
    By edger in forum Excel General
    Replies: 1
    Last Post: 02-10-2006, 06:40 PM
  7. Attaching One Worksheet to Email
    By KeshnerH in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-26-2005, 04:06 PM
  8. [SOLVED] attaching tabs to email
    By please help in forum Excel General
    Replies: 3
    Last Post: 01-19-2005, 04:06 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1