Word Macros

download Word Macros

If you can't read please download the document

description

Word Macros

Transcript of Word Macros

Sub copy_1_line()'' copy_1_line Macro''Selection.PasteAndFormat (wdFormatOriginalFormatting)Selection.HomeKey Unit:=wdLineSelection.Range.Style = ActiveDocument.Styles(wdStyleNormal)Selection.MoveDown Unit:=wdParagraph, Count:=1Application.Run MacroName:="Normal.NewMacros.put_bullet"End SubSub copy_5_lines()'' copy_5_lines Macro''Selection.PasteAndFormat (wdFormatOriginalFormatting)Selection.MoveUp Unit:=wdLine, Count:=4Selection.EndKey Unit:=wdLineSelection.TypeText Text:=" "Selection.Delete Unit:=wdCharacter, Count:=1Selection.EndKey Unit:=wdLineSelection.TypeText Text:=" "Selection.Delete Unit:=wdCharacter, Count:=1Selection.EndKey Unit:=wdLineSelection.MoveDown Unit:=wdLine, Count:=1Selection.TypeText Text:=" "Selection.Delete Unit:=wdCharacter, Count:=1Selection.EndKey Unit:=wdLineSelection.TypeText Text:=" "Selection.Delete Unit:=wdCharacter, Count:=1Selection.MoveUp Unit:=wdParagraph, Count:=1Selection.Range.Style = ActiveDocument.Styles(wdStyleNormal)Selection.MoveDown Unit:=wdParagraph, Count:=1Selection.TypeParagraphApplication.Run MacroName:="Normal.NewMacros.put_bullet"End SubSub copy_4_lines()'' copy_4_lines Macro''Selection.PasteAndFormat (wdFormatOriginalFormatting)Selection.MoveUp Unit:=wdLine, Count:=3Selection.EndKey Unit:=wdLineSelection.TypeText Text:=" "Selection.Delete Unit:=wdCharacter, Count:=1Selection.EndKey Unit:=wdLineSelection.TypeText Text:=" "Selection.Delete Unit:=wdCharacter, Count:=1Selection.MoveDown Unit:=wdLine, Count:=1Selection.TypeText Text:=" "Selection.Delete Unit:=wdCharacter, Count:=1Selection.MoveUp Unit:=wdParagraph, Count:=1Selection.Range.Style = ActiveDocument.Styles(wdStyleNormal)Selection.MoveDown Unit:=wdParagraph, Count:=1Selection.TypeParagraphApplication.Run MacroName:="Normal.NewMacros.put_bullet"End SubSub copy_3_lines()'' copy_3_lines Macro''Selection.PasteAndFormat (wdFormatOriginalFormatting)Selection.MoveUp Unit:=wdLine, Count:=1Selection.TypeText Text:=" "Selection.EndKey Unit:=wdLineSelection.Delete Unit:=wdCharacter, Count:=1Selection.MoveUp Unit:=wdParagraph, Count:=1Selection.Range.Style = ActiveDocument.Styles(wdStyleNormal)With ListGalleries(wdBulletGallery).ListTemplates(7).ListLevels(1).NumberFormat = ChrW(61656).TrailingCharacter = wdTrailingTab.NumberStyle = wdListNumberStyleBullet.NumberPosition = InchesToPoints(0.25).Alignment = wdListLevelAlignLeft.TextPosition = InchesToPoints(0.5).TabPosition = wdUndefined.ResetOnHigher = 0.StartAt = 1With .Font.Bold = wdUndefined.Italic = wdUndefined.StrikeThrough = wdUndefined.Subscript = wdUndefined.Superscript = wdUndefined.Shadow = wdUndefined.Outline = wdUndefined.Emboss = wdUndefined.Engrave = wdUndefined.AllCaps = wdUndefined.Hidden = wdUndefined.Underline = wdUndefined.Color = wdUndefined.Size = wdUndefined.Animation = wdUndefined.DoubleStrikeThrough = wdUndefined.Name = "Wingdings"End With.LinkedStyle = ""End WithListGalleries(wdBulletGallery).ListTemplates(7).Name = ""Selection.Range.ListFormat.ApplyListTemplateWithLevel ListTemplate:= _ListGalleries(wdBulletGallery).ListTemplates(7), ContinuePreviousList:= _True, ApplyTo:=wdListApplyToWholeList, DefaultListBehavior:= _wdWord10ListBehaviorSelection.MoveDown Unit:=wdParagraph, Count:=1Selection.Paragraphs(1).SelectNumberSelection.MoveDown Unit:=wdParagraph, Count:=1Application.Run MacroName:="Normal.NewMacros.put_bullet"End SubSub copy_2_lines()'' copy_2_lines Macro''Selection.PasteAndFormat (wdFormatOriginalFormatting)Selection.MoveUp Unit:=wdLine, Count:=1Selection.EndKey Unit:=wdLineSelection.TypeText Text:=" "Selection.Delete Unit:=wdCharacter, Count:=1Selection.HomeKey Unit:=wdLineSelection.Range.Style = ActiveDocument.Styles(wdStyleNormal)With ListGalleries(wdBulletGallery).ListTemplates(7).ListLevels(1).NumberFormat = ChrW(61656).TrailingCharacter = wdTrailingTab.NumberStyle = wdListNumberStyleBullet.NumberPosition = InchesToPoints(0.25).Alignment = wdListLevelAlignLeft.TextPosition = InchesToPoints(0.5).TabPosition = wdUndefined.ResetOnHigher = 0.StartAt = 1With .Font.Bold = wdUndefined.Italic = wdUndefined.StrikeThrough = wdUndefined.Subscript = wdUndefined.Superscript = wdUndefined.Shadow = wdUndefined.Outline = wdUndefined.Emboss = wdUndefined.Engrave = wdUndefined.AllCaps = wdUndefined.Hidden = wdUndefined.Underline = wdUndefined.Color = wdUndefined.Size = wdUndefined.Animation = wdUndefined.DoubleStrikeThrough = wdUndefined.Name = "Wingdings"End With.LinkedStyle = ""End WithListGalleries(wdBulletGallery).ListTemplates(7).Name = ""Selection.Range.ListFormat.ApplyListTemplateWithLevel ListTemplate:= _ListGalleries(wdBulletGallery).ListTemplates(7), ContinuePreviousList:= _True, ApplyTo:=wdListApplyToWholeList, DefaultListBehavior:= _wdWord10ListBehaviorSelection.MoveDown Unit:=wdParagraph, Count:=1Selection.Paragraphs(1).SelectNumberSelection.MoveDown Unit:=wdParagraph, Count:=1Application.Run MacroName:="Normal.NewMacros.put_bullet"End SubSub put_indent_bullet()'' put_bullet Macro''Selection.Paragraphs(1).SelectNumberSelection.MoveUp Unit:=wdParagraph, Count:=1Selection.Range.Style = ActiveDocument.Styles(wdStyleNormal)Selection.MoveDown Unit:=wdParagraph, Count:=1, Extend:=wdExtendSelection.Font.Name = "Calibri"Selection.Font.Size = 11With ListGalleries(wdBulletGallery).ListTemplates(7).ListLevels(1).NumberFormat = "o".TrailingCharacter = wdTrailingTab.NumberStyle = wdListNumberStyleBullet.NumberPosition = InchesToPoints(0.75).Alignment = wdListLevelAlignLeft.TextPosition = InchesToPoints(1).TabPosition = wdUndefined.ResetOnHigher = 0.StartAt = 1With .Font.Bold = wdUndefined.Italic = wdUndefined.StrikeThrough = wdUndefined.Subscript = wdUndefined.Superscript = wdUndefined.Shadow = wdUndefined.Outline = wdUndefined.Emboss = wdUndefined.Engrave = wdUndefined.AllCaps = wdUndefined.Hidden = wdUndefined.Underline = wdUndefined.Color = wdUndefined.Size = wdUndefined.Animation = wdUndefined.DoubleStrikeThrough = wdUndefined.Name = "Courier New"End With.LinkedStyle = ""End WithListGalleries(wdBulletGallery).ListTemplates(7).Name = ""Selection.Range.ListFormat.ApplyListTemplateWithLevel ListTemplate:= _ListGalleries(wdBulletGallery).ListTemplates(7), ContinuePreviousList:= _True, ApplyTo:=wdListApplyToWholeList, DefaultListBehavior:= _wdWord10ListBehaviorSelection.MoveDown Unit:=wdParagraph, Count:=1End SubSub put_bullet()'' put_bullet Macro''Selection.Paragraphs(1).SelectNumberSelection.MoveUp Unit:=wdParagraph, Count:=1Selection.Range.Style = ActiveDocument.Styles(wdStyleNormal)Selection.MoveDown Unit:=wdParagraph, Count:=1, Extend:=wdExtendSelection.Font.Name = "Calibri"Selection.Font.Size = 11With ListGalleries(wdBulletGallery).ListTemplates(7).ListLevels(1).NumberFormat = ChrW(61656).TrailingCharacter = wdTrailingTab.NumberStyle = wdListNumberStyleBullet.NumberPosition = InchesToPoints(0.25).Alignment = wdListLevelAlignLeft.TextPosition = InchesToPoints(0.5).TabPosition = wdUndefined.ResetOnHigher = 0.StartAt = 1With .Font.Bold = wdUndefined.Italic = wdUndefined.StrikeThrough = wdUndefined.Subscript = wdUndefined.Superscript = wdUndefined.Shadow = wdUndefined.Outline = wdUndefined.Emboss = wdUndefined.Engrave = wdUndefined.AllCaps = wdUndefined.Hidden = wdUndefined.Underline = wdUndefined.Color = wdUndefined.Size = wdUndefined.Animation = wdUndefined.DoubleStrikeThrough = wdUndefined.Name = "Wingdings"End With.LinkedStyle = ""End WithListGalleries(wdBulletGallery).ListTemplates(7).Name = ""Selection.Range.ListFormat.ApplyListTemplateWithLevel ListTemplate:= _ListGalleries(wdBulletGallery).ListTemplates(7), ContinuePreviousList:= _True, ApplyTo:=wdListApplyToWholeList, DefaultListBehavior:= _wdWord10ListBehaviorSelection.MoveDown Unit:=wdParagraph, Count:=1Selection.TypeParagraphSelection.MoveUp Unit:=wdLine, Count:=1End SubSub delete_para()'' delete_para Macro''Selection.MoveDown Unit:=wdParagraph, Count:=5, Extend:=wdExtendSelection.CutEnd SubSub copy_6_lines()'' copy_6_lines Macro''Selection.PasteAndFormat (wdFormatOriginalFormatting)Selection.MoveUp Unit:=wdLine, Count:=5Selection.EndKey Unit:=wdLineSelection.TypeText Text:=" "Selection.Delete Unit:=wdCharacter, Count:=1Selection.EndKey Unit:=wdLineSelection.TypeText Text:=" "Selection.Delete Unit:=wdCharacter, Count:=1Selection.EndKey Unit:=wdLineSelection.TypeText Text:=" "Selection.Delete Unit:=wdCharacter, Count:=1Selection.EndKey Unit:=wdLineSelection.MoveDown Unit:=wdLine, Count:=1Selection.TypeText Text:=" "Selection.Delete Unit:=wdCharacter, Count:=1Selection.EndKey Unit:=wdLineSelection.TypeText Text:=" "Selection.Delete Unit:=wdCharacter, Count:=1Selection.MoveUp Unit:=wdParagraph, Count:=1Selection.Range.Style = ActiveDocument.Styles(wdStyleNormal)Selection.MoveDown Unit:=wdParagraph, Count:=1Selection.TypeParagraphApplication.Run MacroName:="Normal.NewMacros.put_bullet"End SubSub format_table()'' format_table Macro''Options.DefaultBorderLineWidth = wdLineWidth050ptWith Selection.Borders(wdBorderTop).LineStyle = Options.DefaultBorderLineStyle.LineWidth = Options.DefaultBorderLineWidth.Color = Options.DefaultBorderColorEnd WithWith Selection.Borders(wdBorderLeft).LineStyle = Options.DefaultBorderLineStyle.LineWidth = Options.DefaultBorderLineWidth.Color = Options.DefaultBorderColorEnd WithWith Selection.Borders(wdBorderBottom).LineStyle = Options.DefaultBorderLineStyle.LineWidth = Options.DefaultBorderLineWidth.Color = Options.DefaultBorderColorEnd WithWith Selection.Borders(wdBorderRight).LineStyle = Options.DefaultBorderLineStyle.LineWidth = Options.DefaultBorderLineWidth.Color = Options.DefaultBorderColorEnd WithWith Selection.Borders(wdBorderHorizontal).LineStyle = Options.DefaultBorderLineStyle.LineWidth = Options.DefaultBorderLineWidth.Color = Options.DefaultBorderColorEnd WithWith Selection.Borders(wdBorderVertical).LineStyle = Options.DefaultBorderLineStyle.LineWidth = Options.DefaultBorderLineWidth.Color = Options.DefaultBorderColorEnd WithOptions.DefaultBorderLineWidth = wdLineWidth150ptWith Selection.Borders(wdBorderTop).LineStyle = Options.DefaultBorderLineStyle.LineWidth = Options.DefaultBorderLineWidth.Color = Options.DefaultBorderColorEnd WithWith Selection.Borders(wdBorderLeft).LineStyle = Options.DefaultBorderLineStyle.LineWidth = Options.DefaultBorderLineWidth.Color = Options.DefaultBorderColorEnd WithWith Selection.Borders(wdBorderBottom).LineStyle = Options.DefaultBorderLineStyle.LineWidth = Options.DefaultBorderLineWidth.Color = Options.DefaultBorderColorEnd WithWith Selection.Borders(wdBorderRight).LineStyle = Options.DefaultBorderLineStyle.LineWidth = Options.DefaultBorderLineWidth.Color = Options.DefaultBorderColorEnd WithSelection.MoveUp Unit:=wdLine, Count:=1Selection.MoveDown Unit:=wdLine, Count:=1Selection.SelectRowSelection.Shading.Texture = wdTextureNoneSelection.Shading.ForegroundPatternColor = wdColorAutomaticSelection.Shading.BackgroundPatternColor = -603923969With Selection.Borders(wdBorderTop).LineStyle = Options.DefaultBorderLineStyle.LineWidth = Options.DefaultBorderLineWidth.Color = Options.DefaultBorderColorEnd WithWith Selection.Borders(wdBorderLeft).LineStyle = Options.DefaultBorderLineStyle.LineWidth = Options.DefaultBorderLineWidth.Color = Options.DefaultBorderColorEnd WithWith Selection.Borders(wdBorderBottom).LineStyle = Options.DefaultBorderLineStyle.LineWidth = Options.DefaultBorderLineWidth.Color = Options.DefaultBorderColorEnd WithWith Selection.Borders(wdBorderRight).LineStyle = Options.DefaultBorderLineStyle.LineWidth = Options.DefaultBorderLineWidth.Color = Options.DefaultBorderColorEnd WithSelection.Tables(1).SelectSelection.MoveDown Unit:=wdLine, Count:=1End SubSub junk()'' junk Macro''Selection.MoveDown Unit:=wdParagraph, Count:=1, Extend:=wdExtendSelection.MoveLeft Unit:=wdWord, Count:=1, Extend:=wdExtendSelection.CutWindows("Investing For Dummies, 6th Edition.docx").ActivateApplication.Run MacroName:="Normal.NewMacros.copy_1_line"Windows("Investing For Dummies, 6th Edition.doc").Activate'Selection.Delete Unit:=wdCharacter, Count:=1Selection.Delete Unit:=wdCharacter, Count:=1Windows("Investing For Dummies, 6th Edition.docx").ActivateEnd Sub