Option Explicit
Option Base 0
'
Public Sub 露芝文様描画マクロ()
Const DEWGLEFT = 90 '描画開始位置X
Const DEWGTOPP = 80 ' Y
'
Const DEWGVSPC = 60 '横-間隔
Const DEWGHSPC = 25 '縦-間隔
'
Const DEWGMWID = 15 '描画幅(90度回転)
Const DEWGMHEI = 40 '描画高さ
Const DEWGMVST = (DEWGMHEI / 5) 'ずれ幅-横
Const DEWGMHST = (DEWGMWID / 8) 'ずれ幅-縦
'
Const DEWGODR0 = 5 '露直径1
Const DEWGODR1 = 3 '露直径2
Const DEWGCOLS = 4 '横/描画数
Const DEWGROWS = 6 '縦/描画数
'
Const DEWGLNWE = 1.5 '線の太さ
'
Const DEWGMADJ = 0.1 '三日月太さ
'---------------------------------------------------------------------------
Dim Ip As Integer, Jp As Integer
Dim Kp As Integer
Dim intDxp As Integer, intDyp As Integer
Dim lngCol(1) As Long
'
lngCol(0) = RGB(148, 0, 211) '←色(濃い)
lngCol(1) = RGB(221, 160, 221) '←色(薄い)
For Jp = 0 To DEWGROWS - 1
intDyp = DEWGTOPP + DEWGHSPC * Jp
For Ip = 0 To DEWGCOLS - IIf((Jp Mod 2) = 0, 1, 2)
intDxp = DEWGLEFT + _
DEWGVSPC * (Ip + 0.5 * (Jp Mod 2))
For Kp = 0 To 1
'*芝(三日月)描画
With ActiveDocument.Shapes.AddShape( _
msoShapeMoon, _
intDxp + DEWGMVST * Kp, _
intDyp - DEWGMHST * Kp, _
DEWGMWID, DEWGMHEI)
.Fill.ForeColor.RGB = lngCol(Jp Mod 2)
.Line.Visible = msoFalse
.Adjustments(1) = DEWGMADJ
.Rotation = 90
End With
'*露(円形)描画
With ActiveDocument.Shapes.AddShape( _
msoShapeOval, _
intDxp + DEWGMHEI - DEWGODR0 * Kp, _
intDyp + DEWGODR0 * Kp, _
Choose(Kp + 1, DEWGODR0, DEWGODR1), _
Choose(Kp + 1, DEWGODR0, DEWGODR1))
.Fill.ForeColor.RGB = lngCol(Jp Mod 2)
.Line.Visible = msoFalse
End With
Next Kp
Next Ip
Next Jp
End Sub