Attribute VB_Name = "NewMacros" Sub AccentsDeTex() Attribute AccentsDeTex.VB_Description = "Macro grabada el 15/08/98 por Ramon Ribó" Attribute AccentsDeTex.VB_ProcData.VB_Invoke_Func = "Normal.NewMacros.Macro1" ' ' AccentsDeTex Macro ' Macro grabada el 15/08/98 por Ramon Ribó ' Selection.Find.ClearFormatting Selection.Find.Replacement.ClearFormatting With Selection.Find .Text = "\'{a}" .Replacement.Text = "á" .Forward = True .Wrap = wdFindContinue .Format = False .MatchCase = False .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With Selection.Find.Execute Replace:=wdReplaceAll With Selection.Find .Text = "\'{e}" .Replacement.Text = "é" .Forward = True .Wrap = wdFindContinue .Format = False .MatchCase = False .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With Selection.Find.Execute Replace:=wdReplaceAll With Selection.Find .Text = "\'{i}" .Replacement.Text = "í" .Forward = True .Wrap = wdFindContinue .Format = False .MatchCase = False .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With Selection.Find.Execute Replace:=wdReplaceAll With Selection.Find .Text = "\'{o}" .Replacement.Text = "ó" .Forward = True .Wrap = wdFindContinue .Format = False .MatchCase = False .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With Selection.Find.Execute Replace:=wdReplaceAll With Selection.Find .Text = "\'{u}" .Replacement.Text = "ú" .Forward = True .Wrap = wdFindContinue .Format = False .MatchCase = False .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With Selection.Find.Execute Replace:=wdReplaceAll ActiveWindow.ActivePane.SmallScroll Down:=-40 Selection.Find.ClearFormatting Selection.Find.Replacement.ClearFormatting With Selection.Find .Text = "\~{n}" .Replacement.Text = "ñ" .Forward = True .Wrap = wdFindContinue .Format = False .MatchCase = False .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With Selection.Find.Execute Replace:=wdReplaceAll End Sub Sub CanviarHipervinculaNormal() Attribute CanviarHipervinculaNormal.VB_Description = "Macro grabada el 26/02/99 por Ramon Ribó" Attribute CanviarHipervinculaNormal.VB_ProcData.VB_Invoke_Func = "Normal.NewMacros.CanviarHipervinculaNormal" ' ' CanviarHipervinculaNormal Macro ' Macro grabada el 26/02/99 por Ramon Ribó ' Selection.Find.ClearFormatting Selection.Find.Style = ActiveDocument.Styles("Hipervínculo") With Selection.Find .Text = "" .Replacement.Text = "" .Forward = True .Wrap = wdFindContinue .Format = True .MatchCase = False .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With Selection.Find.Execute Selection.Find.ClearFormatting Selection.Find.Style = ActiveDocument.Styles("Hipervínculo") With Selection.Find .Text = "" .Replacement.Text = "" .Forward = True .Wrap = wdFindContinue .Format = True .MatchCase = False .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With Selection.Range.Hyperlinks(1).Delete End Sub Sub html2doc() Attribute html2doc.VB_Description = "Macro grabada el 01/03/99 por Ramon Ribó\r\ncanvia estils H1...H4 a Tíitulo1...canvia el look dels estils i desfà els camps de links HTML. " Attribute html2doc.VB_ProcData.VB_Invoke_Func = "Normal.NewMacros.html2doc" ' ' html2doc Macro ' Macro grabada el 01/03/99 por Ramon Ribó ' "&chr(10)&"canvia estils H1...H4 a Tíitulo1...canvia el look dels estils i desfà els camps de links HTML. ' Selection.HomeKey Unit:=wdStory Selection.WholeStory Selection.Fields.Unlink Selection.EscapeKey Selection.MoveRight Unit:=wdCharacter, Count:=2, Extend:=wdExtend Selection.Find.ClearFormatting With Selection.Find .Text = "" .Replacement.Text = "" .Forward = True .Wrap = wdFindAsk .Format = False .MatchCase = False .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With Selection.Find.ClearFormatting Selection.Find.Style = ActiveDocument.Styles("H1") Selection.Find.Replacement.ClearFormatting Selection.Find.Replacement.Style = ActiveDocument.Styles("Título 1") With Selection.Find .Text = "" .Replacement.Text = "" .Forward = True .Wrap = wdFindAsk .Format = True .MatchCase = False .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With Selection.Find.Execute Replace:=wdReplaceAll Selection.Find.ClearFormatting Selection.Find.Style = ActiveDocument.Styles("H2") Selection.Find.Replacement.ClearFormatting Selection.Find.Replacement.Style = ActiveDocument.Styles("Título 2") With Selection.Find .Text = "" .Replacement.Text = "" .Forward = True .Wrap = wdFindAsk .Format = True .MatchCase = False .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With Selection.Find.Execute Replace:=wdReplaceAll Selection.Find.ClearFormatting Selection.Find.Style = ActiveDocument.Styles("H3") Selection.Find.Replacement.ClearFormatting Selection.Find.Replacement.Style = ActiveDocument.Styles("Título 3") With Selection.Find .Text = "" .Replacement.Text = "" .Forward = True .Wrap = wdFindAsk .Format = True .MatchCase = False .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With Selection.Find.Execute Replace:=wdReplaceAll Selection.Find.ClearFormatting Selection.Find.Style = ActiveDocument.Styles("H4") Selection.Find.Replacement.ClearFormatting Selection.Find.Replacement.Style = ActiveDocument.Styles("Título 4") With Selection.Find .Text = "" .Replacement.Text = "" .Forward = True .Wrap = wdFindAsk .Format = True .MatchCase = False .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With Selection.Find.Execute Replace:=wdReplaceAll Selection.MoveDown Unit:=wdScreen, Count:=1 Selection.MoveDown Unit:=wdLine, Count:=2 With ActiveDocument.Styles("Normal") .AutomaticallyUpdate = False .BaseStyle = "" .NextParagraphStyle = "Normal" End With With ActiveDocument.Styles("Normal").Font .Name = "NewCenturySchlbk" .Size = 12 .Bold = False .Italic = False .Underline = wdUnderlineNone .StrikeThrough = False .DoubleStrikeThrough = False .Outline = False .Emboss = False .Shadow = False .Hidden = False .SmallCaps = False .AllCaps = False .ColorIndex = wdAuto .Engrave = False .Superscript = False .Subscript = False .Scaling = 100 .Kerning = 0 .Animation = wdAnimationNone End With With ActiveDocument.Styles("Normal").ParagraphFormat .LeftIndent = CentimetersToPoints(0) .RightIndent = CentimetersToPoints(0) .SpaceBefore = 5 .SpaceAfter = 5 .LineSpacingRule = wdLineSpaceSingle .Alignment = wdAlignParagraphJustify .WidowControl = False .KeepWithNext = False .KeepTogether = False .PageBreakBefore = False .NoLineNumber = False .Hyphenation = True .FirstLineIndent = CentimetersToPoints(0) .OutlineLevel = wdOutlineLevelBodyText End With Selection.HomeKey Unit:=wdStory Selection.EndKey Unit:=wdStory Selection.MoveUp Unit:=wdScreen, Count:=34 Selection.MoveDown Unit:=wdScreen, Count:=1 Selection.HomeKey Unit:=wdStory Selection.Find.ClearFormatting Selection.Find.Style = ActiveDocument.Styles("H4") With Selection.Find .Text = "concept index" .Replacement.Text = "" .Forward = True .Wrap = wdFindContinue .Format = True .MatchCase = False .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With Selection.Find.Execute Selection.Find.ClearFormatting With Selection.Find .Text = "concept index" .Replacement.Text = "" .Forward = True .Wrap = wdFindContinue .Format = True .MatchCase = False .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With Selection.Find.Execute ActiveWindow.ActivePane.SmallScroll Down:=-5 Selection.Find.ClearFormatting With Selection.Find .Text = "concept index" .Replacement.Text = "" .Forward = True .Wrap = wdFindContinue .Format = True .MatchCase = False .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With Selection.HomeKey Unit:=wdLine Selection.EndKey Unit:=wdStory, Extend:=wdExtend Selection.TypeBackspace Selection.HomeKey Unit:=wdStory With ActiveDocument .TablesOfContents.Add Range:=Selection.Range, RightAlignPageNumbers:= _ True, UseHeadingStyles:=True, UpperHeadingLevel:=1, _ LowerHeadingLevel:=1, IncludePageNumbers:=True, AddedStyles:= _ "Título 2;2;Título 3;3;Título 4;4" .TablesOfContents(1).TabLeader = wdTabLeaderDots End With ActiveWindow.ActivePane.View.ShowAll = Not ActiveWindow.ActivePane.View. _ ShowAll If ActiveWindow.View.SplitSpecial = wdPaneNone Then ActiveWindow.ActivePane.View.Type = wdPageView Else ActiveWindow.View.Type = wdPageView End If ActiveWindow.ActivePane.SmallScroll Down:=-7 Selection.InsertBreak Type:=wdSectionBreakNextPage ActiveWindow.ActivePane.SmallScroll Down:=-12 Selection.HomeKey Unit:=wdStory Selection.TypeParagraph Selection.MoveUp Unit:=wdLine, Count:=1 Selection.TypeText Text:="INDEX" Selection.HomeKey Unit:=wdLine Selection.EndKey Unit:=wdLine, Extend:=wdExtend Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter Selection.Font.Name = "NewCenturySchlbk" Selection.Font.Size = 14 If Selection.Font.Underline = wdUnderlineNone Then Selection.Font.Underline = wdUnderlineSingle Else Selection.Font.Underline = wdUnderlineNone End If InsertPageNumber ' ActiveDocument.Save End Sub Sub InsertPageNumber() ' ' InsertPageNumber Macro ' Macro grabada el 15/04/99 por Ramon Ribó ' "&chr(10)&"Adds page number to two sections: index and normal. ' Selection.HomeKey Unit:=wdStory If ActiveWindow.View.SplitSpecial <> wdPaneNone Then ActiveWindow.Panes(2).Close End If If ActiveWindow.ActivePane.View.Type = wdNormalView Or ActiveWindow. _ ActivePane.View.Type = wdOutlineView Or ActiveWindow.ActivePane.View.Type _ = wdMasterView Then ActiveWindow.ActivePane.View.Type = wdPageView End If ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader If Selection.HeaderFooter.IsHeader = True Then ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageFooter Else ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader End If Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter Selection.TypeParagraph Selection.TypeText Text:="-" Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldPage Selection.TypeText Text:="-" With Selection.HeaderFooter.PageNumbers .NumberStyle = wdPageNumberStyleLowercaseRoman .HeadingLevelForChapter = 0 .IncludeChapterNumber = False .ChapterPageSeparator = wdSeparatorHyphen .RestartNumberingAtSection = False .StartingNumber = 0 End With ActiveWindow.ActivePane.View.NextHeaderFooter With Selection.HeaderFooter.PageNumbers .NumberStyle = wdPageNumberStyleArabic .HeadingLevelForChapter = 0 .IncludeChapterNumber = False .ChapterPageSeparator = wdSeparatorHyphen .RestartNumberingAtSection = False .StartingNumber = 0 End With ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument End Sub