forked from byvlstr/ContextDots
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathContextDots_byvlstr
67 lines (55 loc) · 3.31 KB
/
ContextDots_byvlstr
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
Sub ContextDots()
On Error Resume Next
With ActivePresentation
SectionCount = .SectionProperties.Count
' Skip the last section which is assumed to be backup slides
SectionCount = SectionCount - 1
For X = 1 To .Slides.Count
.Slides(X).Shapes("Background").Delete
.Slides(X).Shapes("Bullet").Delete
.Slides(X).Shapes("SectionTitleBox").Delete
Set bg = .Slides(X).Shapes.AddShape(msoShapeRectangle, 0, 0, .PageSetup.SlideWidth, 25)
bg.Name = "Background"
' Change the rectangle's colours here
bg.Fill.ForeColor.RGB = RGB(0, 32, 91)
bg.Line.ForeColor.RGB = RGB(0, 32, 91)
' Change the bullets' size, shape and spacing here
BulletSize = 5
BulletShape = msoShapeOval
BulletSpacing = 2
Offset = 20
SlideNumber = 1
For Y = 1 To SectionCount
If Y <> 1 Then
Offset = (Y - 1) * .PageSetup.SlideWidth / (SectionCount)
End If
TextboxOffset = Offset - 7.5
SectionSlidesCount = .SectionProperties.SlidesCount(Y)
sectionTitle = .SectionProperties.Name(Y)
Set textbox = .Slides(X).Shapes.AddTextbox(msoTextOrientationHorizontal, _
TextboxOffset, -2, 200, 50)
textbox.TextFrame.TextRange.Text = sectionTitle
textbox.Name = "SectionTitleBox"
' Change the font colour, size and type here
textbox.TextFrame.TextRange.Font.Color = vbWhite
textbox.TextFrame.TextRange.Font.Size = 11
textbox.TextFrame.TextRange.Font.Name = "Calibri Light"
For Z = 1 To SectionSlidesCount
Set Bullet = .Slides(X).Shapes.AddShape(BulletShape, _
Offset + (Z - 1) * (BulletSpacing + BulletSize), 16, BulletSize, BulletSize)
Bullet.Name = "Bullet"
Bullet.Line.Weight = 1
' Change the bullets' fill and line colour here (case: Other slide)
Bullet.Fill.ForeColor.RGB = vbBlack
Bullet.Line.ForeColor.RGB = vbWhite
If X = SlideNumber Then
textbox.TextFrame.TextRange.Font.Bold = True
' Change the bullets' fill and line colour here (case: active slide)
Bullet.Fill.ForeColor.RGB = vbWhite
End If
SlideNumber = SlideNumber + 1
Next Z:
Next Y:
Next X:
End With
End Sub