|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
楼主,只须把文字每段一行,再应用下面的宏即可:
- Sub 标签()
- ActiveWindow.ActivePane.View.Zoom.PageFit = wdPageFitBestFit
- With ActiveDocument.PageSetup
- .TopMargin = CentimetersToPoints(2)
- .BottomMargin = CentimetersToPoints(2)
- .LeftMargin = CentimetersToPoints(1)
- .RightMargin = CentimetersToPoints(1)
- End With
- If Selection.Type = wdSelectionIP Then Selection.WholeStory
- Selection.ConvertToTable Separator:=wdSeparateByParagraphs, NumColumns:=1, AutoFitBehavior:=wdAutoFitFixed
- Selection.Tables(1).Style = "网格型"
- Selection.Font.Bold = True
- Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter
- Selection.Cells.VerticalAlignment = wdCellAlignVerticalCenter
- If MsgBox("<是>:纵向(书脊) <否>:横向(封面)", vbYesNo + vbExclamation, "标签 - 请选择!") = vbYes Then
- ActiveDocument.PageSetup.Orientation = wdOrientLandscape
- Selection.Tables(1).Rows.Alignment = wdAlignRowCenter
- Selection.Rows.HeightRule = wdRowHeightExactly
- Selection.Rows.Height = CentimetersToPoints(3)
- Selection.Orientation = wdTextOrientationHorizontalRotatedFarEast
- Selection.ParagraphFormat.Alignment = wdAlignParagraphDistribute
- Selection.Borders(wdBorderLeft).LineStyle = wdLineStyleNone
- Selection.Borders(wdBorderRight).LineStyle = wdLineStyleNone
- Selection.Font.Size = 48
- Else
- Selection.Tables(1).AutoFitBehavior (wdAutoFitWindow)
- Selection.Tables(1).AutoFitBehavior (wdAutoFitWindow)
- Selection.PageSetup.TextColumns.SetCount NumColumns:=2
- Selection.Rows.HeightRule = wdRowHeightExactly
- Selection.Rows.Height = CentimetersToPoints(5)
- Selection.Font.Size = 60
- End If
- ActiveWindow.ActivePane.View.Zoom.PageFit = wdPageFitFullPage
- End Sub
复制代码 |
|