Consulting

Results 1 to 3 of 3

Thread: Update Powerpoint with a field in a form in Access

  1. #1

    Update Powerpoint with a field in a form in Access

    Hi,

    a click on a command button on a continous form in access is supposed to open a powerpoint document, update a specific field (so overwrite the old value), and then save the powerpoint document. The button triggers the same for word documents, and there I got it to work via this code:

    sDocName = "Path + document name"
    WrdName = "doc name"
    WrdSpPfad = "path"

    Set RS = DB.OpenRecordset("Base", dbOpenDynaset)

    Set wdAnw = CreateObject("Word.Application")

    Set oDoc = wdAnw.Documents.Open(sDocName)

    wdAnw.Visible = False

    oDoc.FormFields("Text1").Result = Me!ID

    oDoc.SaveAs FileName:=WrdSpPfad & WrdName & ".doc"

    wdAnw.WindowState = wdWindowStateMinimize
    oDoc.Close
    wdAnw.Quit True
    Set wdDok = Nothing
    Set wdAnw = Nothing
    Set oDoc = Nothing

    On the receiving word doc is a text field ("Text1") which receives the Me.ID field from the access form. I tried now to do the same with powerpoint, but didnīt succeed. Any ideas how this could work?

    Thanks a lot for feedback!

  2. #2
    VBAX Expert
    Joined
    Oct 2012
    Posts
    726
    Location
    Set ppApp = New PowerPoint.Application
    Set ppPres = ppApp.Presentations.Open(StrPath, WithWindow:=msoFalse)
    Set ppSld = ppPres.Slides(1)
    For Each shp In ppSld.Shapes
        Debug.Print shp.Name, shp.TextEffect.Text
    Next
    
    ppSld.Shapes(1).TextEffect.Text = "hello"

  3. #3
    Thanks a lot! Works!

Posting Permissions

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