Results 1 to 4 of 4
  1. #1
    Thompyt is offline Expert
    Windows 8 Access 2010 32bit
    Join Date
    Sep 2014
    Location
    El Paso, TX
    Posts
    862

    Open PPT with own template.


    With the following code I either get an open blank PPT presentation with the generic template. if I set it top open my custom template it opens the template or "Master View." How do I get it to open a new PPT with my template? This is a start as I will get into formatting later on.

    Code:
    Sub cmdPowerPoint_Click()
        Dim db As DAO.Database
        Dim rst As DAO.Recordset
        Dim ppObj As PowerPoint.Application
        Dim ppPres As PowerPoint.Presentation
        Dim sTemplate As String
        On Error GoTo ErrorMsgs
        
        Set db = CurrentDb
        Set rs = db.OpenRecordset("Weekly Closed", dbOpenDynaset)
      
        Set ppObj = New PowerPoint.Application   
        'Set ppPres = ppObj.Presentations.Open("C:\Users\username\Documents\Custom Office Templates\Weekly Closed.potx")   'This opens in "Master View"
        Set ppPres = ppObj.Presentations.Add     'This opens the  generic presentation
        With ppPres
            While Not rs.EOF
                With .Slides.Add(rs.AbsolutePosition + 1, ppLayoutTitle)
                    .Shapes(1).TextFrame.TextRange.Text = "Weekly Closed CR's"
                    '.SlideShowTransition.EntryEffect = ppEffectFade
                    With .Shapes(2).TextFrame.TextRange
                        .Text = CStr(rs.Fields("[Change Requested]").Value)
                        '.Characters.Font.Color.RGB = RGB(255, 0, 255)
                        '.Characters.Font.Shadow = True
                    End With
                    .Shapes(1).TextFrame.TextRange.Characters.Font.Size = 20
                End With
                rs.MoveNext
            Wend
        End With
        Exit Sub
    ErrorMsgs:
    err_cmdOLEPowerPoint:
        MsgBox Err.Number & " " & Err.Description
    End Sub

  2. #2
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442

  3. #3
    Thompyt is offline Expert
    Windows 8 Access 2010 32bit
    Join Date
    Sep 2014
    Location
    El Paso, TX
    Posts
    862
    Thanks, I'll check it out.

  4. #4
    Thompyt is offline Expert
    Windows 8 Access 2010 32bit
    Join Date
    Sep 2014
    Location
    El Paso, TX
    Posts
    862
    Thanks rpeare that helped me on my way.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Open Word Template from Form Control
    By tanyad in forum Import/Export Data
    Replies: 2
    Last Post: 04-05-2012, 10:13 PM
  2. Replies: 1
    Last Post: 01-09-2012, 05:57 PM
  3. Command button to open email template
    By avarusbrightfyre in forum Import/Export Data
    Replies: 5
    Last Post: 09-10-2011, 11:18 AM
  4. I need help with this Template
    By Elizabeth28 in forum Access
    Replies: 3
    Last Post: 07-26-2009, 10:49 AM
  5. Looking for a template
    By caabruss in forum Access
    Replies: 0
    Last Post: 04-21-2009, 07:57 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums