|
本帖最后由 413191246se 于 2015-8-8 14:15 编辑
* 纯属纸上谈兵,并非和真实文件头(红头文件)相符,请朋友们体验一下,可以用方向键上下移动图形,文本框中的文字可以自行修改,仅为填补空白,提供一份辅助便利。
- Sub 电子文件头()
- '文本框(红头文件)
- Documents.Add
- ActiveDocument.Shapes.AddTextbox(msoTextOrientationHorizontal, 90#, 72#, 369#, 46.8).Select
- Selection.ShapeRange.TextFrame.TextRange.Select
- Selection.Collapse
- Selection.TypeText Text:="辽宁省朝阳市通用模板公司附属分公司文件"
- Selection.ShapeRange.Select
- With Selection.Font
- ' .Name = "宋体"
- .Size = 36
- .Bold = True
- .Color = wdColorRed
- .Scaling = 50
- End With
- Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter
- Selection.ParagraphFormat.Alignment = wdAlignParagraphDistribute
- Selection.ShapeRange.Fill.Transparency = 1#
- Selection.ShapeRange.Line.Visible = msoFalse
- Selection.ShapeRange.LockAspectRatio = msoTrue
- Selection.ShapeRange.Height = 50
- Selection.ShapeRange.Width = 413
- Selection.ShapeRange.Left = wdShapeCenter
- '文本框(文号)
- ActiveDocument.Shapes.AddTextbox(msoTextOrientationHorizontal, 198#, 125.4, 225#, 39#).Select
- Selection.ShapeRange.TextFrame.TextRange.Select
- Selection.ShapeRange.Select
- Selection.ShapeRange.Fill.Transparency = 1#
- Selection.ShapeRange.Line.Visible = msoFalse
- Selection.TypeText Text:="朝通模司字〔2015〕23号"
- Selection.ShapeRange.Select
- Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter
- Selection.Font.Size = 16
- Selection.Font.Name = "仿宋_GB2312"
- Selection.Font.Bold = True
- Selection.Font.Name = "Times New Roman"
- Selection.ShapeRange.Left = wdShapeCenter
- '线条(右上宽高)
- ActiveDocument.Shapes.AddLine(89#, 174.6, 505#, 174.6).Select
- Selection.ShapeRange.Line.Weight = 4.5
- Selection.ShapeRange.Line.Style = msoLineThinThick
- Selection.ShapeRange.Line.ForeColor.RGB = RGB(255, 0, 0)
- Selection.ShapeRange.Left = wdShapeCenter
- '文本框(不透明,衬托五角星)
- ActiveDocument.Shapes.AddTextbox(msoTextOrientationHorizontal, 270#, 156.8, 42#, 40.8).Select
- Selection.ShapeRange.Line.Visible = msoFalse
- Selection.ShapeRange.Left = wdShapeCenter
- '五角星
- ActiveDocument.Shapes.AddShape(msoShape5pointStar, 297#, 160.4, 27#, 25.65).Select
- Selection.ShapeRange.Fill.ForeColor.RGB = RGB(255, 0, 0)
- Selection.ShapeRange.Line.Weight = 0.25
- Selection.ShapeRange.Line.ForeColor.RGB = RGB(255, 0, 0)
- Selection.ShapeRange.LockAspectRatio = msoTrue
- Selection.ShapeRange.Left = wdShapeCenter
- Selection.ShapeRange.ScaleWidth 1, msoFalse, msoScaleFromTopLeft
- Selection.ShapeRange.ScaleHeight 1, msoFalse, msoScaleFromTopLeft
- '组合
- ActiveDocument.Shapes.Range(Array("Text Box 2", "Text Box 3", "Line 4", "Text Box 5", "AutoShape 6")).Select
- Selection.ShapeRange.Group.Select
- Selection.ShapeRange.LockAspectRatio = msoTrue
- End Sub
复制代码 |
|