Skip to content

Commit 5e712e8

Browse files
committed
Update 1.21
Updated settings dialog, taking locale settings into account. Added cleanup function: Remove hidden slides
1 parent 3930f98 commit 5e712e8

13 files changed

+115
-55
lines changed
-1.27 KB
Binary file not shown.

src/CustomUI/CustomUI.xml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -408,10 +408,11 @@
408408
<button id="cleaning3" label="Remove speaker notes from all slides" imageMso="Clear" onAction="CleanUpRemoveSpeakerNotesFromAllSlides" />
409409
<button id="cleaning4" label="Remove comments from all slides" imageMso="Clear" onAction="CleanUpRemoveCommentsFromAllSlides" />
410410
<button id="cleaning5" label="Remove unused master slides" imageMso="Clear" onAction="CleanUpRemoveUnusedMasterSlides" />
411+
<button id="cleaning6" label="Remove hidden slides" imageMso="Clear" onAction="CleanUpRemoveHiddenSlides" />
411412
<menuSeparator id="separatorConvertAnonymize" />
412-
<button id="cleaning6" label="Convert slides to pictures (readonly)" imageMso="Clear" onAction="ConvertSlidesToPictures" />
413-
<button id="cleaning7" label="Watermark and then convert slides to pictures (readonly)" imageMso="WatermarkCustomDialog" onAction="InsertWatermarkAndConvertSlidesToPictures" />
414-
<button id="cleaning8" label="Anonymize slides with Lorem Ipsum" imageMso="Clear" onAction="AnonymizeWithLoremIpsum" />
413+
<button id="cleaning7" label="Convert slides to pictures (readonly)" imageMso="Clear" onAction="ConvertSlidesToPictures" />
414+
<button id="cleaning8" label="Watermark and then convert slides to pictures (readonly)" imageMso="WatermarkCustomDialog" onAction="InsertWatermarkAndConvertSlidesToPictures" />
415+
<button id="cleaning9" label="Anonymize slides with Lorem Ipsum" imageMso="Clear" onAction="AnonymizeWithLoremIpsum" />
415416
</menu>
416417
<toggleButton idMso="SelectionPane" showLabel="false" />
417418
<splitButton id="TagsSplitButton" size="normal" showLabel="false" tag="P" getVisible="InstrumentaGetVisible">

src/Forms/SettingsForm.frm

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ Attribute VB_Exposed = False
3737

3838
Private Sub UserForm_Activate()
3939

40-
ShapeStepSizeMargin = GetSetting("Instrumenta", "Shapes", "ShapeStepSizeMargin", "0.2")
41-
TableStepSizeMargin = GetSetting("Instrumenta", "Tables", "TableStepSizeMargin", "0.2")
42-
TableStepSizeColumnGaps = GetSetting("Instrumenta", "Tables", "TableStepSizeColumnGaps", "1.0")
43-
TableStepSizeRowGaps = GetSetting("Instrumenta", "Tables", "TableStepSizeRowGaps", "1.0")
40+
ShapeStepSizeMargin = GetSetting("Instrumenta", "Shapes", "ShapeStepSizeMargin", "0" + GetDecimalSeperator() + "2")
41+
TableStepSizeMargin = GetSetting("Instrumenta", "Tables", "TableStepSizeMargin", "0" + GetDecimalSeperator() + "2")
42+
TableStepSizeColumnGaps = GetSetting("Instrumenta", "Tables", "TableStepSizeColumnGaps", "1" + GetDecimalSeperator() + "0")
43+
TableStepSizeRowGaps = GetSetting("Instrumenta", "Tables", "TableStepSizeRowGaps", "1" + GetDecimalSeperator() + "0")
4444
StickyNotesDefaultText = GetSetting("Instrumenta", "StickyNotes", "StickyNotesDefaultText", "Note")
4545

4646
If GetSetting("Instrumenta", "General", "OperatingMode", "pro") = "pro" Then
@@ -63,26 +63,26 @@ End Sub
6363

6464
Private Sub SaveSettingsButton_Click()
6565

66-
If ShapeStepSizeMargin = "" Or ShapeStepSizeMargin Like "*[!0-9.]*" Then
67-
MsgBox ("Please enter data in the following format ###.#")
66+
If ShapeStepSizeMargin = "" Or ShapeStepSizeMargin Like "*[!0-9" + GetDecimalSeperator() + "]*" Then
67+
MsgBox ("Please enter data in the following format #" + GetDecimalSeperator() + "#")
6868
ShapeStepSizeMargin.SetFocus
6969
Exit Sub
7070
End If
7171

72-
If TableStepSizeMargin = "" Or TableStepSizeMargin Like "*[!0-9.]*" Then
73-
MsgBox ("Please enter data in the following format ###.#")
72+
If TableStepSizeMargin = "" Or TableStepSizeMargin Like "*[!0-9" + GetDecimalSeperator() + "]*" Then
73+
MsgBox ("Please enter data in the following format #" + GetDecimalSeperator() + "#")
7474
TableStepSizeMargin.SetFocus
7575
Exit Sub
7676
End If
7777

78-
If TableStepSizeColumnGaps = "" Or TableStepSizeColumnGaps Like "*[!0-9.]*" Then
79-
MsgBox ("Please enter data in the following format ###.#")
78+
If TableStepSizeColumnGaps = "" Or TableStepSizeColumnGaps Like "*[!0-9" + GetDecimalSeperator() + "]*" Then
79+
MsgBox ("Please enter data in the following format #" + GetDecimalSeperator() + "#")
8080
TableStepSizeColumnGaps.SetFocus
8181
Exit Sub
8282
End If
8383

84-
If TableStepSizeRowGaps = "" Or TableStepSizeRowGaps Like "*[!0-9.]*" Then
85-
MsgBox ("Please enter data in the following format ###.#")
84+
If TableStepSizeRowGaps = "" Or TableStepSizeRowGaps Like "*[!0-9" + GetDecimalSeperator() + "]*" Then
85+
MsgBox ("Please enter data in the following format #" + GetDecimalSeperator() + "#")
8686
TableStepSizeRowGaps.SetFocus
8787
Exit Sub
8888
End If
@@ -109,6 +109,8 @@ Private Sub ShapeStepSizeMargin_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger
109109

110110
If KeyAscii = 46 Then
111111
KeyAscii = 46
112+
ElseIf KeyAscii = 44 Then
113+
KeyAscii = 44
112114
ElseIf KeyAscii < 48 Or KeyAscii > 57 Then
113115
KeyAscii = 0
114116
End If
@@ -118,6 +120,8 @@ End Sub
118120
Private Sub TableStepSizeMargin_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
119121
If KeyAscii = 46 Then
120122
KeyAscii = 46
123+
ElseIf KeyAscii = 44 Then
124+
KeyAscii = 44
121125
ElseIf KeyAscii < 48 Or KeyAscii > 57 Then
122126
KeyAscii = 0
123127
End If
@@ -127,6 +131,8 @@ End Sub
127131
Private Sub TableStepSizeColumnGaps_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
128132
If KeyAscii = 46 Then
129133
KeyAscii = 46
134+
ElseIf KeyAscii = 44 Then
135+
KeyAscii = 44
130136
ElseIf KeyAscii < 48 Or KeyAscii > 57 Then
131137
KeyAscii = 0
132138
End If
@@ -136,6 +142,8 @@ End Sub
136142
Private Sub TableStepSizeRowGaps_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
137143
If KeyAscii = 46 Then
138144
KeyAscii = 46
145+
ElseIf KeyAscii = 44 Then
146+
KeyAscii = 44
139147
ElseIf KeyAscii < 48 Or KeyAscii > 57 Then
140148
KeyAscii = 0
141149
End If

src/Forms/SettingsForm.frx

512 Bytes
Binary file not shown.
-3.3 KB
Binary file not shown.

src/Modules/ModuleAbout.bas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Attribute VB_Name = "ModuleAbout"
2424
Public InstrumentaVersion As String
2525

2626
Sub ShowAboutDialog()
27-
InstrumentaVersion = "1.2"
27+
InstrumentaVersion = "1.21"
2828
AboutDialog.Label1.Caption = "Instrumenta Powerpoint Toolbar v" & InstrumentaVersion
2929
AboutDialog.Show
3030
End Sub

src/Modules/ModuleCleanUp.bas

Lines changed: 33 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Sub CleanUpRemoveUnusedMasterSlides()
2929
On Error Resume Next
3030

3131
DesignsCount = ActivePresentation.Designs.Count
32-
32+
3333
For NumberOfDesigns = ActivePresentation.Designs.Count To 1 Step -1
3434

3535
SetProgress ((DesignsCount - NumberOfDesigns) / DesignsCount * 100)
@@ -44,9 +44,9 @@ Sub CleanUpRemoveUnusedMasterSlides()
4444
Next NumberOfDesigns
4545

4646
On Error GoTo 0
47-
47+
4848
ProgressForm.Hide
49-
49+
5050
End Sub
5151

5252
Sub CleanUpRemoveAnimationsFromAllSlides()
@@ -56,9 +56,9 @@ Sub CleanUpRemoveAnimationsFromAllSlides()
5656
ProgressForm.Show
5757

5858
For Each PresentationSlide In ActivePresentation.Slides
59-
60-
SetProgress (PresentationSlide.SlideNumber / ActivePresentation.Slides.Count * 100)
61-
59+
60+
SetProgress (PresentationSlide.SlideNumber / ActivePresentation.Slides.Count * 100)
61+
6262
For AnimationCount = PresentationSlide.TimeLine.MainSequence.Count To 1 Step -1
6363
PresentationSlide.TimeLine.MainSequence.Item(AnimationCount).Delete
6464
Next AnimationCount
@@ -75,9 +75,9 @@ Sub CleanUpRemoveSpeakerNotesFromAllSlides()
7575
ProgressForm.Show
7676

7777
For Each PresentationSlide In ActivePresentation.Slides
78-
79-
SetProgress (PresentationSlide.SlideNumber / ActivePresentation.Slides.Count * 100)
80-
78+
79+
SetProgress (PresentationSlide.SlideNumber / ActivePresentation.Slides.Count * 100)
80+
8181
For Each SlideShape In PresentationSlide.NotesPage.Shapes
8282
If SlideShape.TextFrame.HasText Then
8383
SlideShape.TextFrame.TextRange = ""
@@ -96,9 +96,9 @@ Sub CleanUpRemoveCommentsFromAllSlides()
9696
ProgressForm.Show
9797

9898
For Each PresentationSlide In ActivePresentation.Slides
99-
100-
SetProgress (PresentationSlide.SlideNumber / ActivePresentation.Slides.Count * 100)
101-
99+
100+
SetProgress (PresentationSlide.SlideNumber / ActivePresentation.Slides.Count * 100)
101+
102102
For CommentsCount = PresentationSlide.Comments.Count To 1 Step -1
103103
PresentationSlide.Comments(1).Delete
104104
Next
@@ -108,7 +108,6 @@ Sub CleanUpRemoveCommentsFromAllSlides()
108108

109109
End Sub
110110

111-
112111
Sub CleanUpRemoveSlideShowTransitionsFromAllSlides()
113112
Dim PresentationSlide As Slide
114113

@@ -123,4 +122,24 @@ Sub CleanUpRemoveSlideShowTransitionsFromAllSlides()
123122

124123
End Sub
125124

126-
125+
Sub CleanUpRemoveHiddenSlides()
126+
127+
ProgressForm.Show
128+
129+
NumberOfSlides = ActivePresentation.Slides.Count
130+
131+
For SlideLoop = ActivePresentation.Slides.Count To 1 Step -1
132+
133+
SetProgress ((NumberOfSlides - SlideLoop) / NumberOfSlides * 100)
134+
135+
If ActivePresentation.Slides(SlideLoop).SlideShowTransition.Hidden = msoTrue Then
136+
137+
ActivePresentation.Slides(SlideLoop).Delete
138+
139+
End If
140+
141+
Next
142+
143+
ProgressForm.Hide
144+
145+
End Sub

src/Modules/ModuleFunctions.bas

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,13 @@ Private Declare PtrSafe Function WindowsColorDialog Lib "comdlg32.dll" Alias "Ch
4949
Private Const CC_SOLIDCOLOR = &H80
5050
#End If
5151

52+
53+
Function GetDecimalSeperator() As String
54+
55+
GetDecimalSeperator = Mid(CStr(1 / 2), 2, 1)
56+
57+
End Function
58+
5259
Function RemoveDuplicates(InputArray) As Variant
5360

5461
Dim OutputArray, InputValue, OutputValue As Variant
@@ -127,15 +134,6 @@ CheckIfAppleScriptPluginIsInstalled = 0
127134

128135
End Function
129136

130-
'This does not work well in all cases
131-
'Function MacSendMailViaOutlook(subject As String, filepath As String)
132-
'MacSendMailViaOutlookMacScript = "tell application ""Microsoft Outlook""" & vbNewLine & "set NewMail to (make new outgoing message with properties {subject:""" & subject & """})" & vbNewLine & _
133-
'"tell NewMail" & vbNewLine & "set AttachmentPath to POSIX file """ & filepath & """" & vbNewLine & "make new attachment with properties {file:AttachmentPath as alias}" & vbNewLine & "Delay 0.5" & vbNewLine & _
134-
'"end tell" & vbNewLine & "open NewMail" & vbNewLine & "Activate NewMail" & vbNewLine & "end tell" & vbNewLine & "return ""Done"""
135-
'MacSendMailViaOutlook = MacScript(MacSendMailViaOutlookMacScript)
136-
'End Function
137-
138-
139137
#If Mac Then
140138

141139
Function ColorDialog(StandardColor As Variant) As Variant
@@ -172,13 +170,15 @@ Function ColorDialog(StandardColor As Variant) As Variant
172170
PredefinedColors(ExtraColorCount - 1) = ActivePresentation.ExtraColors(ExtraColorCount)
173171
Next
174172
End If
175-
176-
PredefinedColors(10) = ActivePresentation.SlideMaster.Theme.ThemeColorScheme(msoThemeAccent1).RGB
177-
PredefinedColors(11) = ActivePresentation.SlideMaster.Theme.ThemeColorScheme(msoThemeAccent2).RGB
178-
PredefinedColors(12) = ActivePresentation.SlideMaster.Theme.ThemeColorScheme(msoThemeAccent3).RGB
179-
PredefinedColors(13) = ActivePresentation.SlideMaster.Theme.ThemeColorScheme(msoThemeAccent4).RGB
180-
PredefinedColors(14) = ActivePresentation.SlideMaster.Theme.ThemeColorScheme(msoThemeAccent5).RGB
181-
PredefinedColors(15) = ActivePresentation.SlideMaster.Theme.ThemeColorScheme(msoThemeAccent6).RGB
173+
174+
With ActivePresentation.SlideMaster.Theme
175+
PredefinedColors(10) = .ThemeColorScheme(msoThemeAccent1).RGB
176+
PredefinedColors(11) = .ThemeColorScheme(msoThemeAccent2).RGB
177+
PredefinedColors(12) = .ThemeColorScheme(msoThemeAccent3).RGB
178+
PredefinedColors(13) = .ThemeColorScheme(msoThemeAccent4).RGB
179+
PredefinedColors(14) = .ThemeColorScheme(msoThemeAccent5).RGB
180+
PredefinedColors(15) = .ThemeColorScheme(msoThemeAccent6).RGB
181+
End With
182182

183183
With ChooseColorType
184184
.lStructSize = Len(ChooseColorType)
@@ -199,4 +199,3 @@ End Function
199199

200200
#End If
201201

202-

src/Modules/ModuleObjectsText.bas

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ Sub ObjectsMarginsIncrease()
340340
Else
341341

342342
Dim ShapeMarginSetting As Double
343-
ShapeMarginSetting = CDbl(GetSetting("Instrumenta", "Shapes", "ShapeStepSizeMargin", "0.2"))
343+
ShapeMarginSetting = CDbl(GetSetting("Instrumenta", "Shapes", "ShapeStepSizeMargin", "0" + GetDecimalSeperator() + "2"))
344344

345345

346346
If myDocument.Selection.HasChildShapeRange Then
@@ -369,7 +369,7 @@ Sub ObjectsMarginsDecrease()
369369
Else
370370

371371
Dim ShapeMarginSetting As Double
372-
ShapeMarginSetting = CDbl(GetSetting("Instrumenta", "Shapes", "ShapeStepSizeMargin", "0.2"))
372+
ShapeMarginSetting = CDbl(GetSetting("Instrumenta", "Shapes", "ShapeStepSizeMargin", "0" + GetDecimalSeperator() + "2"))
373373

374374
If myDocument.Selection.HasChildShapeRange Then
375375

src/Modules/ModuleSettings.bas

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
Attribute VB_Name = "ModuleSettings"
2+
'MIT License
3+
4+
'Copyright (c) 2021 iappyx
5+
6+
'Permission is hereby granted, free of charge, to any person obtaining a copy
7+
'of this software and associated documentation files (the "Software"), to deal
8+
'in the Software without restriction, including without limitation the rights
9+
'to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
'copies of the Software, and to permit persons to whom the Software is
11+
'furnished to do so, subject to the following conditions:
12+
13+
'The above copyright notice and this permission notice shall be included in all
14+
'copies or substantial portions of the Software.
15+
16+
'THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
'IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
'FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
'AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
'LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
'OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
'SOFTWARE.
23+
24+
Sub DeleteAllInstrumentaSettings()
25+
SaveSetting "Instrumenta", "temp", "temp", "temp"
26+
DeleteSetting ("Instrumenta")
27+
SettingsForm.Hide
28+
End Sub

0 commit comments

Comments
 (0)