

This could probably be better coded using regex.By Dawn Bjork, MCT, MOSM | The Software Pro To use it, change the AltText to "", then the subroutine will replace all in the text box by their value. = before + getProperty(propname, ) + after ' If property doesn't exist or we increment sStart to skip this property on next loop
:max_bytes(150000):strip_icc()/using-the-slide-master-powerpoint-R2-5c262c1f46e0fb0001ac4085.jpg)
Propname = Mid(, sStart + 1, sEnd - sStart - 1) SEnd = InStr(sStart,, "]")īefore = Mid(, 1, sStart - 1)Īfter = Mid(, sEnd + 1) ' scan all elements of page for textbox with tagged "altText/title" field with ""

Here is my updated code if someone needs it: Sub updateProperties() I updated the subroutine a bit myself so that it handles my use case: I needed to insert several custom properties in the same text box, and 1 text box per property couldn't work for me. ' scan for customised properties of the named valueįor Each p In ' scan for standard MS (file) properties of the named valueįor Each p In ' if generated name created return the value ' insert the slide number into the document If Len(author) > 0 And Len(company) > 0 Then ' add separator for author/company if both exist GetProperty = getProperty + yearFrom + "-" ' get the named document property (with optional default)įunction getProperty(propname, Optional def As String) As String ' set the text box to the requested value Propname = Trim(Mid(obj.Title, sStart, sEnd - 2)) ' extract property from between square brackets

' scan all elements of page for textbox with tagged "altText/title" field with "[" ' parse all slides in the active presentation (document)įor Each processPage In ' Copy document properties into all slides
