Results 1 to 2 of 2

VBA: View/Print PPT with slides and shapes identified by name

Threaded View

abkar VBA: View/Print PPT with... 01-06-2017, 12:06 PM
kev_ Re: VBA: View/Print PPT with... 01-07-2017, 06:21 AM
  1. #1
    Registered User
    Join Date
    12-26-2014
    Location
    Ohio, USA
    MS-Off Ver
    2013
    Posts
    7

    VBA: View/Print PPT with slides and shapes identified by name

    Hello, I have a PowerPoint presentation that includes named slides and shapes. I would like to view and/or print the presentation with each slide and shape name visible. I have code that creates a .txt file with the slide number, slide name, and shape name for each shape on each slide (code below & .txt file output attached).

    I have thought that a solution could be to loop through each slide and each shape and "print" the names to the Notes section of the corresponding slide and/or copy/paste the information into the Notes of the correct slide from the .txt file or from .xlsx file containing info from the .txt file.
    - I have been able to add a text box to the Notes with slide number and slide name. I have not been able to loop through each shape on the slide and include each shape's name in the note (code below).


    Preferable to that would be to identify the slide and each shape on that side by showing each object's border in conjunction with its name.

    Any guidance/solutions would be appreciated. Thank you.

    Below code is used to create .txt file with slide number, slide name, and shape names.
    Sub PPTSlideNames()
    'creates text file with all slide names and shape names
    
    FileHandle = FreeFile
    Open "PathOfFile.NameOfFile.txt" For Output As FileHandle
    Print #FileHandle, Application.ActivePresentation.Name
    Print #FileHandle, " "
    
    Dim x As Long
    
    For x = 1 To ActivePresentation.Slides.Count
        Print #FileHandle, ActivePresentation.Slides(x).SlideNumber, ActivePresentation.Slides(x).Name
        
        With ActivePresentation.Slides(x)
           Dim y As Long
           For y = 1 To .Shapes.Count
           Print #FileHandle, .SlideNumber, .Shapes(y).Name
           Next y
        End With
        
        Print #FileHandle, " "
        Next x
        
    Close #FileHandle
    
    End Sub

    Below code creates a text box with slide number and slide name in Notes of slide.
    Sub PPTInfoFiletoNote()
    Dim x As Long
    
    For x = 1 To ActivePresentation.Slides.Count
        Dim oDestSlide As PowerPoint.Slide
        Set oDestSlide = ActivePresentation.Slides(x)
        
    Dim SlideInfo As String
        SlideInfo = oDestSlide.SlideNumber
        SlideInfo = SlideInfo & " " & oDestSlide.Name
    
        Dim oTextBox As PowerPoint.Shape
        Set oTextBox = oDestSlide.NotesPage.Shapes.AddTextbox(msoTextOrientationHorizontal, Left:=58, Top:=359, Width:=461, Height:=340)
        oTextBox.TextFrame.TextRange.Text = SlideInfo
        
    Next x
    End Sub
    Thank you!
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. View/Print PPT with slides and shapes identified by name
    By abkar in forum PowerPoint Programming
    Replies: 0
    Last Post: 01-05-2017, 12:36 PM
  2. Replies: 0
    Last Post: 01-11-2015, 06:22 PM
  3. Creating a presentation of a few slides from multiple slides
    By zneff in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-02-2014, 10:54 AM
  4. [SOLVED] Automatically Print Once Dynamic Print Range is Identified
    By ccowman in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-27-2013, 10:34 AM
  5. Print Sheets Identified by Checkbox
    By woods in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-14-2008, 04:42 PM
  6. [SOLVED] How do I view color onscreen (it shows up in print view only)
    By janice in forum Excel General
    Replies: 1
    Last Post: 08-15-2006, 02:35 PM
  7. column is hidden in normal view but not print view
    By Bianca in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-23-2006, 03:45 AM

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