画方格纸出现的问题,我想方格的宽度与高度用文本框输入,然后毫米转换成points,为什么不行? 如果gd=8,kd=8就可以呢? Private Sub Button_Click() Dim i On Error Resume Next Dim fgm(4) As String Dim fgh As Integer Dim fgL As Integer gd = MillimetersToPoints(gd.Text) kd = MillimetersToPoints(kd.Text) fg = 120 fgg = 120 fgh = xcount.Text fgL = ycount.Text With ActiveDocument.Shapes.BuildFreeform(msoEditingAuto, fg, fgg) fg1 = 0 fgg2 = fgg For i = 0 To fgh If fg1 = 0 Then fg1 = kd * fgL Else fg1 = 0 End If fg2 = fg1 + fg .AddNodes msoSegmentLine, msoEditingAuto, fg2, fgg2 fgg1 = fgg1 + kd
fgg2 = fgg1 + fgg If i = fgh Then kkp = 0 Else .AddNodes msoSegmentLine, msoEditingAuto, fg2, fgg2 End If Next i .ConvertToShape.Select End With Selection.ShapeRange.IncrementRotation 180# fgm(0) = Selection.ShapeRange(1).Name With ActiveDocument.Shapes.BuildFreeform(msoEditingAuto, fg, fgg) fgg1 = 0 fg1 = 0 fgg2 = fgg For i = 0 To fgL If fg1 = 0 Then fg1 = gd * fgh Else fg1 = 0 End If fg2 = fg1 + fg .AddNodes msoSegmentLine, msoEditingAuto, fgg2, fg2 fgg1 = fgg1 +kd fgg2 = fgg1 + fgg If i = fgL Then kkp = 0 Else .AddNodes msoSegmentLine, msoEditingAuto, fgg2, fg2 End If Next i .ConvertToShape.Select End With fgm(1) = Selection.ShapeRange(1).Name ActiveDocument.Shapes.Range(Array(fgm(0), fgm(1))).Select Selection.ShapeRange.Group.Select Unload fgform End Sub
[此贴子已经被作者于2007-5-23 20:03:33编辑过] |