|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
如果楼主及各位会用 VBA 宏代码,可以试用下面我自编的《会议标牌》宏:(这个省事儿!)
- Sub 会议标牌_单张()
- '本宏未实际打印,页边距可自行调整,字体/字号等亦请自行调整。
- Dim i As String
- i = InputBox("请输入文字!", "会议标牌_单张", "办公室")
- If i = "" Then Exit Sub
- Documents.Add DocumentType:=wdNewBlankDocument
- With ActiveDocument.Styles(wdStyleNormal).Font
- If .NameFarEast = .NameAscii Then
- .NameAscii = ""
- End If
- .NameFarEast = ""
- End With
- With ActiveDocument.PageSetup
- .LineNumbering.Active = False
- .Orientation = wdOrientLandscape
- .TopMargin = CentimetersToPoints(3.17)
- .BottomMargin = CentimetersToPoints(3.17)
- .LeftMargin = CentimetersToPoints(2.54)
- .RightMargin = CentimetersToPoints(2.54)
- .Gutter = CentimetersToPoints(0)
- .HeaderDistance = CentimetersToPoints(1.5)
- .FooterDistance = CentimetersToPoints(1.75)
- .PageWidth = CentimetersToPoints(29.7)
- .PageHeight = CentimetersToPoints(21)
- .FirstPageTray = wdPrinterDefaultBin
- .OtherPagesTray = wdPrinterDefaultBin
- .SectionStart = wdSectionNewPage
- .OddAndEvenPagesHeaderFooter = False
- .DifferentFirstPageHeaderFooter = False
- .VerticalAlignment = wdAlignVerticalTop
- .SuppressEndnotes = False
- .MirrorMargins = False
- .TwoPagesOnOne = False
- .BookFoldPrinting = False
- .BookFoldRevPrinting = False
- .BookFoldPrintingSheets = 1
- .GutterPos = wdGutterPosLeft
- .LayoutMode = wdLayoutModeLineGrid
- End With
- ActiveWindow.ActivePane.View.Zoom.PageFit = wdPageFitFullPage
- ActiveDocument.Tables.Add Range:=Selection.Range, NumRows:=1, NumColumns:= _
- 2, DefaultTableBehavior:=wdWord9TableBehavior, AutoFitBehavior:=wdAutoFitFixed
- Selection.TypeText Text:=i
- Selection.MoveRight Unit:=wdCell
- Selection.TypeText Text:=i
- Selection.Tables(1).Select
- Selection.Font.Bold = True
- Selection.Font.Name = "黑体"
- Selection.Font.Size = 42
- Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend
- Selection.HomeKey Unit:=wdLine
- Selection.EndKey Unit:=wdLine, Extend:=wdExtend
- Selection.Orientation = wdTextOrientationDownward
- Selection.MoveRight Unit:=wdCell
- Selection.Orientation = wdTextOrientationUpward
- Selection.Tables(1).Select
- Selection.Rows.HeightRule = wdRowHeightAtLeast
- Selection.Rows.Height = CentimetersToPoints(15)
- Selection.SelectCell
- Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter
- Selection.Cells.VerticalAlignment = wdCellAlignVerticalCenter
- Selection.Font.Size = 130
- Selection.Borders(wdBorderTop).LineStyle = wdLineStyleNone
- Selection.Borders(wdBorderLeft).LineStyle = wdLineStyleNone
- Selection.Borders(wdBorderBottom).LineStyle = wdLineStyleNone
- Selection.Borders(wdBorderRight).LineStyle = wdLineStyleNone
- Selection.Borders(wdBorderVertical).LineStyle = wdLineStyleNone
- Selection.Borders(wdBorderDiagonalDown).LineStyle = wdLineStyleNone
- Selection.Borders(wdBorderDiagonalUp).LineStyle = wdLineStyleNone
- Selection.HomeKey Unit:=wdLine
- ActiveWindow.View.TableGridlines = True
- End Sub
复制代码 |
|