最新文章专题视频专题问答1问答10问答100问答1000问答2000关键字专题1关键字专题50关键字专题500关键字专题1500TAG最新视频文章推荐1 推荐3 推荐5 推荐7 推荐9 推荐11 推荐13 推荐15 推荐17 推荐19 推荐21 推荐23 推荐25 推荐27 推荐29 推荐31 推荐33 推荐35 推荐37视频文章20视频文章30视频文章40视频文章50视频文章60 视频文章70视频文章80视频文章90视频文章100视频文章120视频文章140 视频2关键字专题关键字专题tag2tag3文章专题文章专题2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章专题3
当前位置: 首页 - 正文

word文档编辑之常用的宏

来源:动视网 责编:小OO 时间:2025-10-02 00:06:51
文档

word文档编辑之常用的宏

word文档编辑之常用的宏2011-07-1805:28宏能简化文档编辑中重复性的动作,大大提高了效率。现将本人在使用word软件中录制的宏存下来以备忘:Subautonew()ActiveWindow.ActivePane.View.Zoom.PageFit=wdPageFitBestFitEndSubSubautoopen()ActiveWindow.ActivePane.View.Zoom.PageFit=wdPageFitBestFitEndSubSub讲义页面设置()''讲义页面设置
推荐度:
导读word文档编辑之常用的宏2011-07-1805:28宏能简化文档编辑中重复性的动作,大大提高了效率。现将本人在使用word软件中录制的宏存下来以备忘:Subautonew()ActiveWindow.ActivePane.View.Zoom.PageFit=wdPageFitBestFitEndSubSubautoopen()ActiveWindow.ActivePane.View.Zoom.PageFit=wdPageFitBestFitEndSubSub讲义页面设置()''讲义页面设置
word文档编辑之常用的宏

2011-07-18 05:28

宏能简化文档编辑中重复性的动作,大大提高了效率。现将本人在使用word软件中录制的宏存下来以备忘:

Sub autonew()

ActiveWindow.ActivePane.View.Zoom.PageFit = wdPageFitBestFit

End Sub

Sub autoopen()

ActiveWindow.ActivePane.View.Zoom.PageFit = wdPageFitBestFit

End Sub

Sub 讲义页面设置()

'

' 讲义页面设置 宏

'

'

With Selection.PageSetup

.LineNumbering.Active = False

.Orientation = wdOrientPortrait

.TopMargin = CentimetersToPoints(2.54)

.BottomMargin = CentimetersToPoints(2.54)

.LeftMargin = CentimetersToPoints(3.17)

.RightMargin = CentimetersToPoints(3.17)

.Gutter = CentimetersToPoints(0)

.HeaderDistance = CentimetersToPoints(1.5)

.FooterDistance = CentimetersToPoints(1.75)

.PageWidth = CentimetersToPoints(19.69)

.PageHeight = CentimetersToPoints(27.31)

.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

.LinesPage = 44

.LayoutMode = wdLayoutModeLineGrid

End With

With ActiveDocument.Styles(wdStyleNormal).Font

If .NameFarEast = .NameAscii Then

.NameAscii = ""

End If

.NameFarEast = ""

End With

With ActiveDocument.PageSetup

.LineNumbering.Active = False

.Orientation = wdOrientPortrait

.TopMargin = CentimetersToPoints(2.8)

.BottomMargin = CentimetersToPoints(2.3)

.LeftMargin = CentimetersToPoints(4)

.RightMargin = CentimetersToPoints(1)

.Gutter = CentimetersToPoints(0)

.HeaderDistance = CentimetersToPoints(1.5)

.FooterDistance = CentimetersToPoints(1.75)

.PageWidth = CentimetersToPoints(19.69)

.PageHeight = CentimetersToPoints(27.31)

.FirstPageTray = wdPrinterDefaultBin

.OtherPagesTray = wdPrinterDefaultBin

.SectionStart = wdSectionNewPage

.OddAndEvenPagesHeaderFooter = False

.DifferentFirstPageHeaderFooter = False

.VerticalAlignment = wdAlignVerticalTop

.SuppressEndnotes = False

.MirrorMargins = True

.TwoPagesOnOne = False

.BookFoldPrinting = False

.BookFoldRevPrinting = False

.BookFoldPrintingSheets = 1

.GutterPos = wdGutterPosLeft

.LayoutMode = wdLayoutModeLineGrid

End With

End Sub

Sub 段落编辑()

'

' 段落编辑 宏

'

'

Selection.WholeStory

With Selection.ParagraphFormat

.LeftIndent = CentimetersToPoints(0)

.RightIndent = CentimetersToPoints(0)

.SpaceBefore = 0

.SpaceBeforeAuto = False

.SpaceAfter = 0

.SpaceAfterAuto = False

.LineSpacingRule = wdLineSpaceSingle

.Alignment = wdAlignParagraphJustify

.FirstLineIndent = CentimetersToPoints(0.35)

.OutlineLevel = wdOutlineLevelBodyText

.CharacterUnitLeftIndent = 0

.CharacterUnitRightIndent = 0

.CharacterUnitFirstLineIndent = 2

.LineUnitBefore = 0

.LineUnitAfter = 0

.MirrorIndents = False

.AutoAdjustRightIndent = False

.DisableLineHeightGrid = True

.WordWrap = True

End With

End Sub

Sub 替换整理()

'

' 替换整理 宏

'

'

Selection.Find.ClearFormatting

Selection.Find.Replacement.ClearFormatting

With Selection.Find

.Text = "^l"

.Replacement.Text = "^p"

.Forward = True

.Wrap = wdFindContinue

.Format = False

.MatchCase = False

.MatchWholeWord = False

.MatchByte = False

.MatchWildcards = False

.MatchSoundsLike = False

.MatchAllWordForms = False

End With

Selection.Find.Execute Replace:=wdReplaceAll

Selection.Find.ClearFormatting

Selection.Find.Replacement.ClearFormatting

With Selection.Find

.Text = "^p^p"

.Replacement.Text = "^p"

.Forward = True

.Wrap = wdFindContinue

.Format = False

.MatchCase = False

.MatchWholeWord = False

.MatchByte = False

.MatchWildcards = False

.MatchSoundsLike = False

.MatchAllWordForms = False

End With

Selection.Find.Execute Replace:=wdReplaceAll

Selection.Find.ClearFormatting

Selection.Find.Replacement.ClearFormatting

With Selection.Find

.Text = "^w"

.Replacement.Text = ""

.Forward = True

.Wrap = wdFindContinue

.Format = False

.MatchCase = False

.MatchWholeWord = False

.MatchByte = False

.MatchWildcards = False

.MatchSoundsLike = False

.MatchAllWordForms = False

End With

Selection.Find.Execute Replace:=wdReplaceAll

End Sub

Sub 打印排版()

'

' 打印排版 宏

'

'

Selection.WholeStory

With Selection.PageSetup

.LineNumbering.Active = False

.Orientation = wdOrientPortrait

.TopMargin = CentimetersToPoints(2.54)

.BottomMargin = CentimetersToPoints(2.54)

.LeftMargin = CentimetersToPoints(1.9)

.RightMargin = CentimetersToPoints(1.9)

.Gutter = CentimetersToPoints(0)

.HeaderDistance = CentimetersToPoints(1.5)

.FooterDistance = CentimetersToPoints(1.75)

.PageWidth = CentimetersToPoints(21)

.PageHeight = CentimetersToPoints(29.7)

.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

.LinesPage = 44

.LayoutMode = wdLayoutModeLineGrid

End With

Selection.Font.Bold = wdToggle

Selection.Font.Name = "宋体"

Selection.Font.Size = 9

If ActiveWindow.View.SplitSpecial <> wdPaneNone Then

ActiveWindow.Panes(2).Close

End If

If ActiveWindow.ActivePane.View.Type <> wdPrintView Then

ActiveWindow.ActivePane.View.Type = wdPrintView

End If

With Selection.PageSetup.TextColumns

.SetCount NumColumns:=2

.EvenlySpaced = True

.LineBetween = False

End With

End Sub

Sub 着重号()

'

' 着重号 宏

'

'

With Selection.Font

.EmphasisMark = wdEmphasisMarkUnderSolidCircle

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

ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader

Selection.WholeStory

Selection.Delete Unit:=wdCharacter, Count:=1

Selection.Delete Unit:=wdCharacter, Count:=1

Selection.Delete Unit:=wdCharacter, Count:=1

Selection.Delete Unit:=wdCharacter, Count:=1

ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument

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

ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageFooter

Selection.WholeStory

Selection.Delete Unit:=wdCharacter, Count:=1

Selection.Delete Unit:=wdCharacter, Count:=1

ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument

End Sub

文档

word文档编辑之常用的宏

word文档编辑之常用的宏2011-07-1805:28宏能简化文档编辑中重复性的动作,大大提高了效率。现将本人在使用word软件中录制的宏存下来以备忘:Subautonew()ActiveWindow.ActivePane.View.Zoom.PageFit=wdPageFitBestFitEndSubSubautoopen()ActiveWindow.ActivePane.View.Zoom.PageFit=wdPageFitBestFitEndSubSub讲义页面设置()''讲义页面设置
推荐度:
  • 热门焦点

最新推荐

猜你喜欢

热门推荐

专题
Top