|
本帖最后由 megawatt 于 2014-6-13 20:09 编辑
cyq.0123 发表于 2014-5-20 06:47
方便培训学生做试题Word模板的工程密码197698cmw怎么不正确,能否告知?我十分想要 我的名字是雷锋:
- Sub CommandButton1_Click()
- Dim SP As Shape
- For Each SP In ActiveDocument.Shapes
- If SP.Type = msoTextBox Then
- SP.Delete
- End If
- Next
- End Sub
- Private Sub CommandButton2_Click()
- ActiveDocument.Shapes.AddTextbox(msoTextOrientationHorizontal, 63#, _
- 87.6, 486#, 335).Select
- Selection.ShapeRange.TextFrame.TextRange.Select
- Selection.Collapse
- Selection.ShapeRange.Select
- Selection.ShapeRange.Fill.Visible = msoTrue
- Selection.ShapeRange.Fill.Solid
- Selection.ShapeRange.Fill.ForeColor.RGB = RGB(255, 255, 255)
- Selection.ShapeRange.Fill.Transparency = 0#
- Selection.ShapeRange.Line.Weight = 6#
- Selection.ShapeRange.Line.DashStyle = msoLineSolid
- Selection.ShapeRange.Line.Style = msoLineSingle
- Selection.ShapeRange.Line.Transparency = 0#
- Selection.ShapeRange.Line.Visible = msoTrue
- Selection.ShapeRange.Line.ForeColor.RGB = RGB(0, 0, 255)
- Selection.ShapeRange.Line.BackColor.RGB = RGB(255, 255, 255)
- Selection.ShapeRange.LockAspectRatio = msoFalse
- Selection.ShapeRange.Height = 335
- Selection.ShapeRange.Width = 486.15
- Selection.ShapeRange.Left = 62.9
- Selection.ShapeRange.Top = 87.55
- Selection.ShapeRange.TextFrame.MarginLeft = 7.09
- Selection.ShapeRange.TextFrame.MarginRight = 7.09
- Selection.ShapeRange.TextFrame.MarginTop = 3.69
- Selection.ShapeRange.TextFrame.MarginBottom = 3.69
- Selection.ShapeRange.RelativeHorizontalPosition = _
- wdRelativeHorizontalPositionColumn
- Selection.ShapeRange.RelativeVerticalPosition = _
- wdRelativeVerticalPositionParagraph
- Selection.ShapeRange.Left = CentimetersToPoints(-0.95)
- Selection.ShapeRange.Top = CentimetersToPoints(0.55)
- Selection.ShapeRange.LockAnchor = False
- Selection.ShapeRange.LayoutInCell = True
- Selection.ShapeRange.WrapFormat.AllowOverlap = True
- Selection.ShapeRange.WrapFormat.Side = wdWrapBoth
- Selection.ShapeRange.WrapFormat.DistanceTop = CentimetersToPoints(0)
- Selection.ShapeRange.WrapFormat.DistanceBottom = CentimetersToPoints(0)
- Selection.ShapeRange.WrapFormat.DistanceLeft = CentimetersToPoints(0.32)
- Selection.ShapeRange.WrapFormat.DistanceRight = CentimetersToPoints(0.32)
- Selection.ShapeRange.WrapFormat.Type = 3
- Selection.ShapeRange.ZOrder 4
- Selection.ShapeRange.TextFrame.AutoSize = False
- Selection.ShapeRange.TextFrame.WordWrap = True
- Selection.TypeText Text:="按题目要求完成:"
- Selection.TypeParagraph
- Selection.TypeText Text:="1. 字体设置:第一行标题为隶书;第二行为仿宋;正文(备注正文是指李白这一首诗)为华文行楷;最后一段解析一词为华文新魏,其余为楷体。"
- Selection.TypeParagraph
- Selection.TypeText Text:="2.设置字号:第一行标题为二号;正文为四号"
- Selection.TypeParagraph
- Selection.TypeText Text:="3.设置字形:“解析”一词加双下划线。给“李白”两字加着重号"
- Selection.TypeParagraph
- Selection.TypeText Text:="4. 设置对齐方式:第一行和第二行为居中对齐"
- Selection.TypeParagraph
- Selection.TypeText Text:="5. 设置段落缩进:正文左缩进2个字符;最后一段首行缩进2个字符。"
- Selection.TypeParagraph
- Selection.TypeText Text:="6.设置行(段落):第一行标题段前段后各为1行;第二行段后为0.5.行;最后一段段前为1行."
- Selection.WholeStory
- Selection.Font.Bold = wdToggle
- Selection.Font.Size = 14
- Selection.Font.Color = wdColorRed
- Selection.ShapeRange.TextFrame.TextRange.Select
- Selection.Collapse
- Selection.ShapeRange.Select
- End Sub
复制代码
|
|