Skip to content

Commit 1a0e45e

Browse files
committed
Add potm
1 parent f2556b5 commit 1a0e45e

40 files changed

Lines changed: 3967 additions & 0 deletions

scripts/Build-VBA.ps1

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ if ($outputFilePath.EndsWith(".dotm")) {
4747
$outputFilePath = $outputFilePath -replace "\.dotm$", ".dotm.docm"
4848
}
4949

50+
if ($outputFilePath.EndsWith(".potm")) {
51+
$outputFilePath = $outputFilePath -replace "\.potm$", ".potm.pptm"
52+
}
53+
5054
if ($outputFilePath.EndsWith(".ppam")) {
5155
$outputFilePath = $outputFilePath -replace "\.ppam$", ".ppam.pptm"
5256
}
@@ -316,6 +320,19 @@ try {
316320
# Delete the .ppam.pptm file
317321
Remove-Item -Path $oldFilePath -Force
318322
Write-Host "Document saved as .ppam"
323+
324+
# Check if the extension is .potm and if so save as .potm
325+
} elseif ($outputFilePath.EndsWith(".potm.pptm")) {
326+
$oldFilePath = $outputFilePath
327+
$outputFilePath = $outputFilePath -replace "\.potm\.pptm$", ".potm"
328+
# Replace forward slashes with backslashes
329+
$outputFilePath = $outputFilePath -replace "/", "\"
330+
Write-Host "Saving document as .potm: $outputFilePath"
331+
$doc.SaveAs($outputFilePath, 17) # 17 is the ppSaveAsOpenXMLTemplateMacroEnabled file format for .potm
332+
# Delete the .potm.pptm file
333+
Remove-Item -Path $oldFilePath -Force
334+
Write-Host "Document saved as .potm"
335+
319336
} else {
320337
$doc.Save()
321338
Write-Host "Document saved successfully"

scripts/Rename-It.ps1

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ if ($fileExtension -eq "dotm") {
3636
$fileExtension = "dotm.docm"
3737
}
3838

39+
# Since we can't edit the .potm file directly, we will use the .potm.pptm file extension
40+
if ($fileExtension -eq "potm") {
41+
$fileExtension = "potm.pptm"
42+
}
43+
3944
# Since we can't edit the .ppam file directly, we will use the .pptm file extension
4045
if ($fileExtension -eq "ppam") {
4146
$fileExtension = "ppam.pptm"
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
Attribute VB_Name = "Module1"
2+
3+
'@Lang VBA
4+
Option Explicit
5+
6+
Sub Demo()
7+
MsgBox "Hello, World!"
8+
End Sub
9+
10+
'This code will be called via COM to test if the VBA import was successful
11+
Sub WriteToFile()
12+
Dim filePath As String
13+
Dim fileNum As Integer
14+
15+
' Specify the path to the text file
16+
filePath = ThisPresentation.Path & "\PowerPointPresentation.txt"
17+
18+
' Get a free file number
19+
fileNum = FreeFile
20+
21+
' Open the file for output
22+
Open filePath For Output As #fileNum
23+
24+
' Write some text to the file
25+
Print #fileNum, "Hello, World!"
26+
27+
' Close the file
28+
Close #fileNum
29+
End Sub
30+
31+
Private Function ThisPresentation() As PowerPoint.Presentation
32+
Dim Pres As Presentation
33+
On Error Resume Next
34+
Set Pres = Presentations("PowerPointPresentation.pptm")
35+
On Error GoTo 0
36+
If Pres Is Nothing Then
37+
'Try to fallback using ActiveVBProject
38+
Dim PresName As String
39+
PresName = Split(Application.VBE.ActiveVBProject.FileName, "\")(UBound(Split(Application.VBE.ActiveVBProject.FileName, "\")))
40+
Set Pres = Presentations(PresName)
41+
End If
42+
Set ThisPresentation = Pres
43+
Exit Function
44+
End Function
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2+
<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">
3+
<Default Extension="jpeg" ContentType="image/jpeg" />
4+
<Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml" />
5+
<Default Extension="xml" ContentType="application/xml" />
6+
<Override PartName="/ppt/presentation.xml" ContentType="application/vnd.ms-powerpoint.presentation.macroEnabled.main+xml" />
7+
<Override PartName="/ppt/slideMasters/slideMaster1.xml" ContentType="application/vnd.openxmlformats-officedocument.presentationml.slideMaster+xml" />
8+
<Override PartName="/ppt/slides/slide1.xml" ContentType="application/vnd.openxmlformats-officedocument.presentationml.slide+xml" />
9+
<Override PartName="/ppt/presProps.xml" ContentType="application/vnd.openxmlformats-officedocument.presentationml.presProps+xml" />
10+
<Override PartName="/ppt/viewProps.xml" ContentType="application/vnd.openxmlformats-officedocument.presentationml.viewProps+xml" />
11+
<Override PartName="/ppt/theme/theme1.xml" ContentType="application/vnd.openxmlformats-officedocument.theme+xml" />
12+
<Override PartName="/ppt/tableStyles.xml" ContentType="application/vnd.openxmlformats-officedocument.presentationml.tableStyles+xml" />
13+
<Override PartName="/ppt/slideLayouts/slideLayout1.xml" ContentType="application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml" />
14+
<Override PartName="/ppt/slideLayouts/slideLayout2.xml" ContentType="application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml" />
15+
<Override PartName="/ppt/slideLayouts/slideLayout3.xml" ContentType="application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml" />
16+
<Override PartName="/ppt/slideLayouts/slideLayout4.xml" ContentType="application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml" />
17+
<Override PartName="/ppt/slideLayouts/slideLayout5.xml" ContentType="application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml" />
18+
<Override PartName="/ppt/slideLayouts/slideLayout6.xml" ContentType="application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml" />
19+
<Override PartName="/ppt/slideLayouts/slideLayout7.xml" ContentType="application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml" />
20+
<Override PartName="/ppt/slideLayouts/slideLayout8.xml" ContentType="application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml" />
21+
<Override PartName="/ppt/slideLayouts/slideLayout9.xml" ContentType="application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml" />
22+
<Override PartName="/ppt/slideLayouts/slideLayout10.xml" ContentType="application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml" />
23+
<Override PartName="/ppt/slideLayouts/slideLayout11.xml" ContentType="application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml" />
24+
<Override PartName="/docProps/core.xml" ContentType="application/vnd.openxmlformats-package.core-properties+xml" />
25+
<Override PartName="/docProps/app.xml" ContentType="application/vnd.openxmlformats-officedocument.extended-properties+xml" />
26+
</Types>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2+
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
3+
<Relationship Id="rId3" Type="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties" Target="docProps/core.xml" />
4+
<Relationship Id="rId2" Type="http://schemas.openxmlformats.org/package/2006/relationships/metadata/thumbnail" Target="docProps/thumbnail.jpeg" />
5+
<Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="ppt/presentation.xml" />
6+
<Relationship Id="rId4" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties" Target="docProps/app.xml" />
7+
</Relationships>
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2+
<Properties xmlns="http://schemas.openxmlformats.org/officeDocument/2006/extended-properties" xmlns:vt="http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes">
3+
<TotalTime>2</TotalTime>
4+
<Words>0</Words>
5+
<Application>Microsoft Office PowerPoint</Application>
6+
<PresentationFormat>Widescreen</PresentationFormat>
7+
<Paragraphs>0</Paragraphs>
8+
<Slides>1</Slides>
9+
<Notes>0</Notes>
10+
<HiddenSlides>0</HiddenSlides>
11+
<MMClips>0</MMClips>
12+
<ScaleCrop>false</ScaleCrop>
13+
<HeadingPairs>
14+
<vt:vector size="6" baseType="variant">
15+
<vt:variant>
16+
<vt:lpstr>Fonts Used</vt:lpstr>
17+
</vt:variant>
18+
<vt:variant>
19+
<vt:i4>3</vt:i4>
20+
</vt:variant>
21+
<vt:variant>
22+
<vt:lpstr>Theme</vt:lpstr>
23+
</vt:variant>
24+
<vt:variant>
25+
<vt:i4>1</vt:i4>
26+
</vt:variant>
27+
<vt:variant>
28+
<vt:lpstr>Slide Titles</vt:lpstr>
29+
</vt:variant>
30+
<vt:variant>
31+
<vt:i4>1</vt:i4>
32+
</vt:variant>
33+
</vt:vector>
34+
</HeadingPairs>
35+
<TitlesOfParts>
36+
<vt:vector size="5" baseType="lpstr">
37+
<vt:lpstr>Aptos</vt:lpstr>
38+
<vt:lpstr>Aptos Display</vt:lpstr>
39+
<vt:lpstr>Arial</vt:lpstr>
40+
<vt:lpstr>Office Theme</vt:lpstr>
41+
<vt:lpstr>PowerPoint Presentation</vt:lpstr>
42+
</vt:vector>
43+
</TitlesOfParts>
44+
<Company>
45+
</Company>
46+
<LinksUpToDate>false</LinksUpToDate>
47+
<SharedDoc>false</SharedDoc>
48+
<HyperlinksChanged>false</HyperlinksChanged>
49+
<AppVersion>16.0000</AppVersion>
50+
</Properties>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2+
<cp:coreProperties xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:dcmitype="http://purl.org/dc/dcmitype/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
3+
<dc:title>
4+
</dc:title>
5+
<dc:creator>Martin Leduc</dc:creator>
6+
<cp:lastModifiedBy>Martin Leduc</cp:lastModifiedBy>
7+
<cp:revision>1</cp:revision>
8+
<dcterms:created xsi:type="dcterms:W3CDTF">2025-04-19T01:26:16Z</dcterms:created>
9+
<dcterms:modified xsi:type="dcterms:W3CDTF">2025-04-19T01:28:20Z</dcterms:modified>
10+
</cp:coreProperties>
1.17 KB
Loading
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2+
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
3+
<Relationship Id="rId3" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/presProps" Target="presProps.xml" />
4+
<Relationship Id="rId2" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/slide" Target="slides/slide1.xml" />
5+
<Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideMaster" Target="slideMasters/slideMaster1.xml" />
6+
<Relationship Id="rId6" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/tableStyles" Target="tableStyles.xml" />
7+
<Relationship Id="rId5" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme" Target="theme/theme1.xml" />
8+
<Relationship Id="rId4" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/viewProps" Target="viewProps.xml" />
9+
</Relationships>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2+
<p:presentationPr xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:p="http://schemas.openxmlformats.org/presentationml/2006/main">
3+
<p:extLst>
4+
<p:ext uri="{E76CE94A-603C-4142-B9EB-6D1370010A27}">
5+
<p14:discardImageEditData xmlns:p14="http://schemas.microsoft.com/office/powerpoint/2010/main" val="0" />
6+
</p:ext>
7+
<p:ext uri="{D31A062A-798A-4329-ABDD-BBA856620510}">
8+
<p14:defaultImageDpi xmlns:p14="http://schemas.microsoft.com/office/powerpoint/2010/main" val="32767" />
9+
</p:ext>
10+
<p:ext uri="{FD5EFAAD-0ECE-453E-9831-46B23BE46B34}">
11+
<p15:chartTrackingRefBased xmlns:p15="http://schemas.microsoft.com/office/powerpoint/2012/main" val="1" />
12+
</p:ext>
13+
</p:extLst>
14+
</p:presentationPr>

0 commit comments

Comments
 (0)