A regular PowerPoint text box cannot accept visitor input during a slide show; replace it with an ActiveX TextBox, then read its Text property through OLEFormat.Object.
This solution requires PowerPoint for Windows desktop. ActiveX controls are not supported in PowerPoint for Mac or PowerPoint for the web.^1^
- If Developer is not visible, open File → Options → Customize Ribbon, select Developer, and click OK.
- Open the survey slide.
- Select Developer → More Controls.
- Choose Microsoft Forms 2.0 TextBox, click OK, and draw the field on the slide.
- With the control selected, open Developer → Properties and set:
- (Name):
SurveyTextBox
- MultiLine:
True if visitors may enter multiple lines
- Start the presentation with Slide Show → From Current Slide and click inside the field.
An ActiveX control remains in design mode while editing the presentation and becomes interactive when the slide show runs.^2^
Do not use Insert → Text Box for the response field. That creates a PowerPoint Shape whose text is intended for slide content, not an interactive slide-show input control.^3^
Use corrected VBA
Press Alt+F11, select Insert → Module, and paste this code:
Option Explicit
Public Sub SaveSurveyResponse()
Dim sld As Slide, ctl As Object
Dim response As String, filePath As String
Dim fileNum As Integer
On Error GoTo Failed
Set sld = SlideShowWindows(1).View.Slide
Set ctl = sld.Shapes("SurveyTextBox").OLEFormat.Object
response = Trim$(ctl.Text)
If Len(response) = 0 Then
MsgBox "Please enter a response.", vbExclamation
Exit Sub
End If
'Remove line breaks so each response remains one CSV record.
response = Replace(response, vbCrLf, " ")
response = Replace(response, vbCr, " ")
response = Replace(response, vbLf, " ")
filePath = CreateObject("WScript.Shell") _
.SpecialFolders("MyDocuments") & "\SurveyResponses.csv"
fileNum = FreeFile
Open filePath For Append As #fileNum
Print #fileNum, """" & Replace(response, """", """""") & """"
Close #fileNum
ctl.Text = ""
MsgBox "Your response was saved.", vbInformation
Exit Sub
Failed:
If fileNum > 0 Then Close #fileNum
MsgBox "The response could not be saved: " & Err.Description, vbCritical
End Sub
OLEFormat.Object returns the embedded control’s object interface, allowing the macro to retrieve its Text value.^4^
Using Windows’ configured Documents location avoids assuming that the folder is always %USERPROFILE%\Documents; this matters when Documents has been redirected, including some OneDrive configurations.
A normal shape can remain the button:
- Select Insert → Shapes and draw a button.
- Enter the label Enter.
- Select the button, then Insert → Action.
- Under Mouse Click, select Run macro.
- Choose
SaveSurveyResponse and click OK.
- Run the slide show, enter a response, and click the button.
- Confirm that
SurveyResponses.csv appears in the configured Documents folder.
Save the presentation through File → Save As → PowerPoint Macro-Enabled Presentation (*.pptm). A normal .pptx file cannot retain the VBA project.^5^
If the ActiveX TextBox cannot be inserted or selected
Microsoft 365 disables ActiveX controls by default. Only change this setting for a presentation whose contents are trusted.^6^
- Open File → Options → Trust Center.
- Select Trust Center Settings → ActiveX Settings.
- Choose Prompt me before enabling all controls with minimal restrictions.
- Click OK twice and reopen the presentation.
- If a security warning appears, select File → Enable Content → Advanced Options → Enable content for this session.^7^
This setting applies across supported Office applications, not only this presentation. In a managed business environment, an administrator may enforce a policy that prevents ActiveX from being enabled; if the options are unavailable or locked, the Microsoft 365 administrator must approve an alternative.
References
- Add or register an ActiveX control
- Use ActiveX Controls on Slides
- Shape object (PowerPoint)
- OLEFormat.Object property (PowerPoint)
- Saving ppt to pptx or pptm | Microsoft Support
- ActiveX controls are disabled by default in Microsoft 365 and Office 2024 | Microsoft Support
- Enable or disable ActiveX settings in Office files | Microsoft Support