I am trying to use a PowerPoint macro written for Windwos on a Mac (Microsoft 365 for Mac). Most of it is working well, but there are two strange things. The major issue: The Mac creates unwanted blank lines.
TextFrame2.TextRange.Text = "Text 1" & vbCrLf & "Text 2" & vbCrLf & "Text 3"
& vbCrLf & creates just a break on Windows PPT, but an additional blank line on the Mac. Any ideas how I can avoid that?
There is a minor issue, too: I thought it's better to use TextFrame2 instead of TextFrame all time, but on the Mac I get a compiling error, when trying to use it with the ruler function close to the end of the code. If anyone has a solution for this, I would be happy, too.
Private Sub ParameterColumnBodyStandard()
Dim shp As Shape
Dim i As Integer
Set shp = ActiveWindow.Selection.ShapeRange(1)
With shp
.Fill.Visible = msoFalse
.Line.Visible = msoFalse
With .TextFrame2
.TextRange.Text = "Text 1" & vbCrLf & "Text 2" & vbCrLf & "Text 3"
.VerticalAnchor = msoAnchorTop
.MarginBottom = 5.6692878
.MarginLeft = 5.6692878
.MarginRight = 5.6692878
.MarginTop = 5.6692878
.WordWrap = msoTrue
With .TextRange
.Font.Size = 16
.Font.Name = "Arial"
.Font.Fill.ForeColor.RGB = RGB(0, 0, 0)
.Font.Bold = msoFalse
.Font.Italic = msoFalse
.Font.UnderlineStyle = msoNoUnderline
.ParagraphFormat.SpaceAfter = 6
.ParagraphFormat.Alignment = ppAlignLeft
.ParagraphFormat.Bullet.UseTextColor = msoFalse
.ParagraphFormat.Bullet.UseTextFont = msoFalse
.ParagraphFormat.Bullet.Font.Fill.ForeColor.RGB = RGB(0, 0, 0)
.Characters(1, 6).Font.Bold = msoFalse
For i = 2 To 3
With .Paragraphs(i).ParagraphFormat.Bullet
.Visible = msoTrue
End With
Next
With .Paragraphs(2)
.ParagraphFormat.IndentLevel = 2
.ParagraphFormat.Bullet.Character = 8226
.ParagraphFormat.Bullet.RelativeSize = 1
End With
With .Paragraphs(3)
.ParagraphFormat.IndentLevel = 3
.ParagraphFormat.Bullet.Character = 8226
.ParagraphFormat.Bullet.RelativeSize = 1
End With
End With
End With
With .TextFrame
With .Ruler
.Levels(2).FirstMargin = 14.173219
.Levels(2).LeftMargin = 28.346439
.Levels(3).FirstMargin = 28.346439
.Levels(3).LeftMargin = 42.519658
End With
End With
End With
End Sub