word 小技巧 无格式粘贴_增强型图元文件粘贴
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
Sub 无格式粘贴()
Selection.PasteAndFormat (wdFormatPlainText)
End Sub
Sub 增强型图元文件()
Selection.Collapse Direction:=wdCollapseStart
Selection.Range.PasteSpecial DataType:=wdPasteEnhanceMetafile
End Sub
Sub 显示比例正常()
On Error Resume Next
ActiveWindow.ActivePane.View.Zoom.Percentage = 100
End Sub
Sub 显示文字宽度()
'
' 显示文字宽度Macro
' 宏在2011/9/29 由AIRDAN 录制
'
ActiveWindow.ActivePane.View.Zoom.PageFit = wdPageFitTextFit End Sub
Sub 当前打印机()
On Error Resume Next
MsgBox (Application.ActivePrinter)
End Sub
Sub A4纸()
On Error Resume Next
ActiveWindow.ActivePane.DisplayRulers = True
With ActiveDocument.PageSetup
.TextColumns.SetCount NumColumns:=1
.TextColumns.EvenlySpaced = True
.Orientation = wdOrientPortrait
.TopMargin = CentimetersToPoints(2.54)
.BottomMargin = CentimetersToPoints(2.54)
.LeftMargin = CentimetersToPoints(3.17)
.RightMargin = CentimetersToPoints(3.17)
.HeaderDistance = CentimetersToPoints(1.5)
.FooterDistance = CentimetersToPoints(1.5)
.PageWidth = CentimetersToPoints(21)
.PageHeight = CentimetersToPoints(29.7) StatusBar = Application.ActivePrinter
End With
ActiveWindow.ActivePane.View.Zoom.Percentage = 100 ActiveWindow.ActivePane.VerticalPercentScrolled = 0 End Sub
Sub 试卷纸39×27_8开()
On Error Resume Next
ActiveWindow.ActivePane.DisplayRulers = True
With ActiveDocument.PageSetup
.Orientation = wdOrientLandscape
.PageWidth = CentimetersToPoints(39)
.PageHeight = CentimetersToPoints(27)
.TextColumns.SetCount NumColumns:=2
.TextColumns.Spacing = CentimetersToPoints(2)
.TopMargin = CentimetersToPoints(2)
.BottomMargin = CentimetersToPoints(2)
.LeftMargin = CentimetersToPoints(2.5)
.RightMargin = CentimetersToPoints(2.5)
.HeaderDistance = CentimetersToPoints(1.5)
.FooterDistance = CentimetersToPoints(1.5) StatusBar = Application.ActivePrinter
End With
ActiveWindow.ActivePane.View.Zoom.Percentage = 100 ActiveWindow.ActivePane.VerticalPercentScrolled = 0 End Sub
Sub 半张试卷_16开()
On Error Resume Next
ActiveWindow.ActivePane.DisplayRulers = True
With ActiveDocument.PageSetup
.TextColumns.SetCount NumColumns:=1
.Orientation = wdOrientPortrait
.TopMargin = CentimetersToPoints(2)
.BottomMargin = CentimetersToPoints(2)
.LeftMargin = CentimetersToPoints(2.5)
.RightMargin = CentimetersToPoints(2.5)
.HeaderDistance = CentimetersToPoints(1.5)
.FooterDistance = CentimetersToPoints(1.5)
.PageWidth = CentimetersToPoints(19.5)
.PageHeight = CentimetersToPoints(27)
StatusBar = Application.ActivePrinter
End With
ActiveWindow.ActivePane.View.Zoom.Percentage = 100 ActiveWindow.ActivePane.VerticalPercentScrolled = 0 End Sub
Sub 去除多余空格()
On Error Resume Next
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = " "
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchByte = True
.MatchWildcards = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
With Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchByte = True
.MatchWildcards = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
ActiveWindow.ActivePane.VerticalPercentScrolled = 0 End Sub
Sub 去除多余回车符()
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "^l"
.Replacement.Text = "^p"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchByte = True
.MatchWildcards = True
End With
Selection.Find.Execute Replace:=wdReplaceAll
With Selection.Find
.Text = "[^13]{2,}"
.Replacement.Text = "^p"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchByte = True
.MatchWildcards = True
End With
Selection.Find.Execute Replace:=wdReplaceAll
ActiveWindow.ActivePane.VerticalPercentScrolled = 0 End Sub
Sub 一键排版()
With ActiveDocument.PageSetup
.LayoutMode = wdLayoutModeDefault
End With
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "^l"
.Replacement.Text = "^13"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchByte = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute Replace:=wdReplaceAll
With Selection.Find
.Text = "[^13]{2,}"
.Replacement.Text = "^p"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchByte = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute Replace:=wdReplaceAll
With Selection.Find
.Text = """(*)"""
.Replacement.Text = ChrW(8220) & "\1" & ChrW(8221)
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchByte = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute Replace:=wdReplaceAll
Selection.WholeStory
Options.DefaultHighlightColorIndex = wdNoHighlight Selection.Range.HighlightColorIndex = wdNoHighlight '去除底纹With Selection.Font
.NameFarEast = "宋体"
.NameAscii = "宋体"
.NameOther = "宋体"
.Name = "宋体"
.Size = 11
.Bold = False
.Italic = False
.Underline = wdUnderlineNone
.UnderlineColor = wdColorAutomatic
.StrikeThrough = False
.DoubleStrikeThrough = False
.Outline = False
.Emboss = False
.Shadow = False
.Hidden = False
.SmallCaps = False
.AllCaps = False
.Color = wdColorBlack
.Engrave = False
.Superscript = False
.Subscript = False
.Spacing = 0
.Scaling = 100
.Position = 0
.Kerning = 0
.Animation = wdAnimationNone
.DisableCharacterSpaceGrid = False
.EmphasisMark = wdEmphasisMarkNone End With
With Selection.ParagraphFormat
.LeftIndent = CentimetersToPoints(0)
.RightIndent = CentimetersToPoints(0)
.SpaceBefore = 0
.SpaceBeforeAuto = False
.SpaceAfter = 0
.SpaceAfterAuto = False
.LineSpacingRule = wdLineSpaceSingle
.Alignment = wdAlignParagraphJustify
.WidowControl = False
.KeepWithNext = False
.KeepTogether = False
.PageBreakBefore = False
.NoLineNumber = False
.Hyphenation = True
.FirstLineIndent = CentimetersToPoints(0)
.OutlineLevel = wdOutlineLevelBodyText
.CharacterUnitLeftIndent = 0
.CharacterUnitRightIndent = 0
.CharacterUnitFirstLineIndent = 2
.LineUnitBefore = 0
.LineUnitAfter = 0
.AutoAdjustRightIndent = True
.DisableLineHeightGrid = False
.FarEastLineBreakControl = True
.WordWrap = True
.HangingPunctuation = True
.HalfWidthPunctuationOnTopOfLine = False
.AddSpaceBetweenFarEastAndAlpha = True
.AddSpaceBetweenFarEastAndDigit = True
.BaseLineAlignment = wdBaselineAlignAuto
End With
ActiveDocument.Paragraphs(1).Range.Select
With Selection.Font
.NameFarEast = "宋体"
.Size = 22
Application.Run MacroName:="Normal.ThisDocument.centerpara"
End With
ActiveWindow.ActivePane.VerticalPercentScrolled = 0
End Sub
Sub 删除重复段落()
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "(<[!^13]*^13)(*)\1"
.Replacement.Text = "\1\2"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchByte = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute Replace:=wdReplaceAll
ActiveWindow.ActivePane.VerticalPercentScrolled = 0
End Sub
Sub 制表位清零()
On Error Resume Next
Selection.ParagraphFormat.TabStops.ClearAll
ActiveDocument.DefaultTabStop = CentimetersToPoints(0)
Selection.EscapeKey
End Sub
Sub 首行缩进()
On Error Resume Next
With Selection.ParagraphFormat
.CharacterUnitFirstLineIndent = 2
End With
End Sub
Sub 插入页码()
If ActiveWindow.View.SplitSpecial <> wdPaneNone Then
ActiveWindow.Panes(2).Close
End If
If ActiveWindow.ActivePane.View.Type = wdNormalView Or ActiveWindow. _ ActivePane.View.Type = wdOutlineView Then
ActiveWindow.ActivePane.View.Type = wdPrintView
End If
Selection.Sections(1).Footers(1).PageNumbers.Add _
PageNumberAlignment:=wdAlignPageNumberCenter, FirstPage:=True With ActiveDocument.Styles("页眉").ParagraphFormat
.Borders(wdBorderBottom).LineStyle = wdLineStyleNone
End With
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageFooter
Selection.ParagraphFormat.Alignment = wdAlignParagraphJustify
ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
ActiveWindow.ActivePane.VerticalPercentScrolled = 0
End Sub
Sub 页眉加横线()
With ActiveDocument.Styles("页眉").ParagraphFormat
.Borders(wdBorderBottom).LineStyle = wdLineStyleSingle End With
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
Selection.Style = ActiveDocument.Styles("页眉")
Selection.TypeText Text:=" "
ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
ActiveWindow.ActivePane.VerticalPercentScrolled = 0
End Sub
Sub 无格式粘贴()
On Error Resume Next
Selection.PasteSpecial Link:=False, DataType:=wdPasteText, Placement:= _ wdInLine, DisplayAsIcon:=False
End Sub
Sub A4纸放大成试卷纸打印()
On Error Resume Next
Application.PrintOut FileName:="", Range:=wdPrintAllDocument, Item:= _ wdPrintDocumentContent, Copies:=1, Pages:="", PageType:=wdPrintAllPages, _
Collate:=True, Background:=True, PrintZoomPaperWidth:=15309, _
PrintZoomPaperHeight:=22113
End Sub
Sub 显示比例加()
On Error Resume Next
h1 = ActiveWindow.ActivePane.View.Zoom.Percentage
h1 = h1 + 5
ActiveWindow.ActivePane.View.Zoom.Percentage = h1
End Sub
Sub 显示比例减()
On Error Resume Next
h1 = ActiveWindow.ActivePane.View.Zoom.Percentage
h1 = h1 - 5
ActiveWindow.ActivePane.View.Zoom.Percentage = h1
End Sub
Sub 显示比例正常()
On Error Resume Next
ActiveWindow.ActivePane.View.Zoom.Percentage = 100
End Sub
Sub 大奖状52×38()
With ActiveDocument.PageSetup
.Orientation = wdOrientLandscape
.PageWidth = CentimetersToPoints(52)
.PageHeight = CentimetersToPoints(38)
.TopMargin = CentimetersToPoints(15)
.BottomMargin = CentimetersToPoints(5.5)
.LeftMargin = CentimetersToPoints(10)
.RightMargin = CentimetersToPoints(10)
End With
Selection.WholeStory
With Selection.Font
.NameFarEast = "隶书"
.Size = 50
End With
ActiveWindow.ActivePane.HorizontalPercentScrolled = 6
ActiveWindow.ActivePane.VerticalPercentScrolled = 39
ActiveWindow.ActivePane.View.Zoom.PageFit = wdPageFitBestFit End Sub
Sub 中奖状39×27()
With ActiveDocument.PageSetup
.Orientation = wdOrientLandscape
.TopMargin = CentimetersToPoints(9.6)
.BottomMargin = CentimetersToPoints(4.4)
.LeftMargin = CentimetersToPoints(7)
.RightMargin = CentimetersToPoints(7)
.PageWidth = CentimetersToPoints(39)
.PageHeight = CentimetersToPoints(27)
End With
Selection.WholeStory
With Selection.Font
.NameFarEast = "隶书"
.Size = 36
End With
ActiveWindow.ActivePane.HorizontalPercentScrolled = 6
ActiveWindow.ActivePane.VerticalPercentScrolled = 55
ActiveWindow.ActivePane.View.Zoom.Percentage = 55
End Sub
Sub 小奖状27×19()
With ActiveDocument.PageSetup
.Orientation = wdOrientLandscape
.TopMargin = CentimetersToPoints(6.5)
.BottomMargin = CentimetersToPoints(3.6)
.LeftMargin = CentimetersToPoints(5)
.RightMargin = CentimetersToPoints(5)
.PageWidth = CentimetersToPoints(27)
.PageHeight = CentimetersToPoints(19)
End With
Selection.WholeStory
With Selection.Font
.NameFarEast = "隶书"
.Size = 22
End With
ActiveWindow.ActivePane.View.Zoom.PageFit = wdPageFitFullPage End Sub。