PowerPoint VBA Code

Joined
Nov 29, 2024
Messages
4
Office Version
  1. 365
Platform
  1. Windows
Please help me to rectify the error in this code

Sub ExportPDFWithoutTags()
Dim pptPres As Presentation
Dim pdfPath As String

' Set the active presentation
Set pptPres = Application.ActivePresentation

' Define the path to save the PDF
pdfPath = Environ("USERPROFILE") & "\Documents\" & Replace(pptPres.Name, ".pptx", ".pdf")

' Export the presentation as a PDF without tags
pptPres.ExportAsFixedFormat _
Path:=pdfPath, _
FixedFormatType:=2, _
Intent:=1, _
FrameSlides:=0, _
HandoutOrder:=0, _
IncludeDocProperties:=False, _
DocStructureTags:=False, _
BitmapMissingFonts:=True, _
UseISO19005_1:=False

MsgBox "PDF exported without tags to: " & pdfPath, vbInformation
End Sub
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
Which line of code is causing the error?

And what type of error is it causing?
 
Upvote 0
Which line of code is causing the error?

And what type of error is it causing?
Hi Domenic,
these lines become red
pptPres.ExportAsFixedFormat _
Path:=pdfPath, _
FixedFormatType:=2, _
Intent:=1, _
FrameSlides:=0, _
HandoutOrder:=0, _
IncludeDocProperties:=False, _
DocStructureTags:=False, _
BitmapMissingFonts:=True, _
UseISO19005_1:=False

I just want to export PPT file to PDF
When we save as PDF Document structure tags for accessibility option is checked, the word "YES" appears in front of TAGGED PDF.
When the option is unchecked, the word "NO" is displayed in front of TAGGED PDF.
I just want to make this option active while exporting the PPT.

Thanks
 
Upvote 0
When I copy your code into a regular code module for a PowerPoint file/presentation, it compiles successfully...
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top