本帖最后由 loquat 于 2015-8-11 23:16 编辑
修正错误
- Sub 电子印章_v5_23()
- '(c) by 413191246se
- '(e) by loquat
- Application.ScreenUpdating = False
- If Documents.count = 0 Then Documents.Add
- Dim i$, s, t, r, arr(1 To 4) As String, x!, f$, a$
- InputMark:
- i = InputBox("请注意! 印章正文(3-30字)和 附言(2-6字)可以一起输入,但必须以中文逗号,分隔!", "电子印章", "辽宁省朝阳市通用模板公司,业务专用章")
- If i = "" Then Exit Sub
- a = InStrRev(i, ",")
- If a Then f = Mid(i, a + 1): i = Left(i, a - 1) Else f = "财务专用章"
- If Len(i) < 3 Or Len(i) > 30 Or Len(f) < 2 Or Len(f) > 6 Then GoTo InputMark
- If Len(f) = 5 Then
- x = 258.4!
- ElseIf Len(f) = 4 Then x = 264.5!
- ElseIf Len(f) = 3 Then x = 263.5!: f = Left(f, 1) & " " & Mid(f, 2, 1) & " " & Right(f, 1)
- ElseIf Len(f) = 2 Then x = 270.5!: f = Left(f, 1) & " " & Right(f, 1)
- ElseIf Len(f) = 6 Then x = 251.5!
- End If
- s = Array(2.4!, 1.98!, 1.7!, 1.48!, 1.33!, 1.19!, 1.08!, 1!, 0.92!, 0.86!, 0.8!, 0.75!, 0.7!, 0.67!, 0.63!, 0.6!, 0.57!, 0.55!, 0.52!, 0.5!, 0.48!, 0.46!, 0.45!, 0.43!, 0.41!, 0.4!, 3!, 3.9!)
- t = Array(4.9!, 3.9!, 3.5!, 3.1!, 2.8!, 2.5!, 2.3!, 2!, 1.8!, 1.7!, 1.6!, 1.5!, 1.4!, 1.3!, 1.32!, 1.27!, 1.2!, 1.1!, 1.1!, 1.05!, 1!, 0.97!, 0.93!, 0.88!, 0.85!, 0.8!, 5!, 5!)
- r = Array(243!, 247!, 251!, 252!, 255!, 257!, 258.5!, 260.5!, 262!, 264!, 264.5!, 265.5!, 266.5!, 267!, 268!, 269!, 269!, 269!, 269!, 269!, 269.5!, 269.5!, 269.5!, 269.5!, 269.9!, 269.9!, 235!, 220!)
- With ActiveDocument.Shapes
- With .AddTextEffect(msoTextEffect3, i, "宋体", 12!, msoFalse, msoFalse, 219.75!, 103!) '艺术字
- .TextEffect.Tracking = t(Len(i) - 5)
- .ScaleHeight 12, msoFalse, msoScaleFromTopLeft
- .ScaleWidth s(Len(i) - 5), msoFalse, msoScaleFromTopLeft
- .Adjustments(1) = r(Len(i) - 5)
- arr(1) = .Name
- End With
- With .AddShape(msoShapeOval, 201.6!, 85!, 180!, 180!) '圆周
- .Fill.Transparency = 1!
- .Line.Style = msoLineThickThin
- arr(2) = .Name
- End With
- arr(3) = .AddShape(msoShape5pointStar, 264!, 147.8!, 54.9!, 47.6).Name '五角星
- With .AddTextEffect(msoTextEffect3, f, "宋体", 13!, msoTrue, msoFalse, x, 206!) '附言
- .TextEffect.PresetShape = msoTextEffectShapePlainText
- .Fill.Visible = msoTrue
- arr(4) = .Name
- End With
- With .Range(Array(arr(1), arr(2), arr(3), arr(4))).Group '组合
- .Fill.ForeColor.RGB = RGB(255, 0, 0)
- .Line.ForeColor.RGB = RGB(255, 0, 0)
- .Line.Weight = 0.25!
- .GroupItems(2).Line.Weight = 3.5
- .LockAspectRatio = msoTrue
- .ScaleWidth 0.6, msoFalse, msoScaleFromTopLeft
- .ScaleHeight 0.6, msoFalse, msoScaleFromTopLeft
- .IncrementTop 92.6!
- .IncrementLeft 119.4!
- .Select
- End With
- End With
- Application.ScreenUpdating = True
- End Sub
复制代码 |