VBA PowerPoint Filler Object

The PowerPointFiller object is used to fill bookmarked locations in a PowerPoint presentation. It is added to your VBA project when you create an PowerPoint presentation creation process using Document Creation using Microsoft Access.

VBA PowerPoint template designer
Drag and drop data filler bookmarks on your presentation in the PowerPoint Template Designer

VBA to fill PowerPoint with data from your database

When closing the Template Designer the process wizard uses supplied information to generate VBA code to fill the new PowerPoint presentation, e.g.:


Dim pfr As New PowerpointFiller: Set pfr.Presentation = prs
pfr.FillElement Bookmark:="Usage", Value:=ControlValue(control:=![Usage])
pfr.AddHyperlink Bookmark:="Hyperlinkintextbox", _
  Value:=ControlValue(control:=![Hyperlink in textbox], UseDisplayValue:=False)
pfr.FillListFromArray Bookmark:="ListofReasonssubform", _
  Array1D:=ValuesInSubFormColumn(control:=![List of Reasons subform], _
  ColumnControlName:="Reason")
pfr.AddHyperlink Bookmark:="Moreinfo", Value:=ControlValue(control:=![More info], _
  UseDisplayValue:=False)
pfr.FillElement Bookmark:="Contact", Value:=ControlValue(control:=![Contact])
pfr.FillPictureFromAttachment Bookmark:="Icon", control:=![Icon]

Bookmarks

Bookmarks normally correspond to the name of the field or control that provides the data. Bookmarks are strings like [CompanyID] with square brackets surrounding the bookmarkname. They are simply intended to be replaced by a data value.

Methods

Adds a hyperlink on the bookmarked place


Public Sub AddHyperlink(Bookmark As String, Value As Variant, _ 
    Optional ParseValue As Boolean = False, Optional TextToDisplay As String, _
                                  Optional SubAddress As String)

ApplyBoolean

Sets default available property


Public Function ApplyBoolean(Bookmark As String, _
      Value As Boolean)

FillElement

FillElement


Public Sub FillElement(Bookmark As String, Value As String)

FillListFromArray

FillListFromArray


Public Sub FillListFromArray(Bookmark As String, Array1D As Variant)

FillOLEObject

Fills the bookmark with an OLEObject from a file.


Public Sub FillOLEObject(Bookmark As String, _
                              FileName As String)

FillPicture

Fills a bookmark with a Picture from file. Returns a PowerPoint.Shape.


Public Function FillPicture(Bookmark As String, ImageFile As String, _ 
  Optional MainResize As dcResizeMain = ResizeWidth) As PowerPoint.Shape

FillPictureFromAttachment

FillPictureFromAttachment. As PowerPoint.Shape


Public Function FillPictureFromAttachment(Bookmark As String, control As Attachment, _ 
  Optional MainResize As dcResizeMain = ResizeWidth, Optional Wrap As String) As PowerPoint.Shape

FillTableFromArray

Fill Table From Array


Public Sub FillTableFromArray(Bookmark As String, var2D As Variant, Optional ColumnOrder As String)

Presentation (Set/Get )

Set the (new) Presentation to add data from the Access database in.


Public Property Set Presentation(rData As PowerPoint.Presentation)
Public Property Get Presentation() As PowerPoint.Presentation