Collapse column

Beiträge anzeigen

Diese Sektion erlaubt es dir alle Beiträge dieses Mitglieds zu sehen. Beachte, dass du nur solche Beiträge sehen kannst, zu denen du auch Zugriffsrechte hast.


Nachrichten - Dominik9020

Seiten: [1]
1
Word / Office 2010: macro in definiertem Bereich
« am: Juni 24, 2014, 15:29:45 Nachmittag »
Hallo zusammen

Ich habe jetzt schon ewig gesucht und finde einfach keine Lösung.
Ich habe Worddokumente mit ca 10 Seiten. das Makro (siehe unten) soll nur aueiner Seite die Formatierung anpassen. wie kann ich den Bereich einschränken, damit nicht auch der Rest des Dokuments formatiert wird.

Zeilen Makro
'
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    Selection.Find.Replacement.ParagraphFormat.TabStops.ClearAll
    Selection.Find.Replacement.ParagraphFormat.TabStops.Add Position:= _
        CentimetersToPoints(5), Alignment:=wdAlignTabLeft, Leader:= _
        wdTabLeaderSpaces
    With Selection.Find
        .Text = "^t^p^t"
        .Replacement.Text = "^t"
        .Forward = True
        .Wrap = wdFindContinue
        .Format = True
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
    ActiveWindow.ActivePane.VerticalPercentScrolled = 0
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    Selection.Find.Replacement.ParagraphFormat.TabStops.ClearAll
    Selection.Find.Replacement.ParagraphFormat.TabStops.Add Position:= _
        CentimetersToPoints(5), Alignment:=wdAlignTabLeft, Leader:= _
        wdTabLeaderSpaces
    With Selection.Find
        .Text = "^t^p^t"
        .Replacement.Text = "^t"
        .Forward = True
        .Wrap = wdFindContinue
        .Format = True
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
    ActiveWindow.ActivePane.VerticalPercentScrolled = 0
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    Selection.Find.Replacement.ParagraphFormat.TabStops.ClearAll
    With Selection.Find
        .Text = "^p^p"
        .Replacement.Text = "^p"
        .Forward = True
        .Wrap = wdFindContinue
        .Format = True
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    Selection.Find.Execute
    ActiveWindow.ActivePane.VerticalPercentScrolled = 13
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    Selection.Find.Replacement.ParagraphFormat.TabStops.ClearAll
    With Selection.Find
        .Text = "^p^p"
        .Replacement.Text = "^p"
        .Forward = True
        .Wrap = wdFindContinue
        .Format = True
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
    ActiveWindow.ActivePane.VerticalPercentScrolled = 0
End Sub

Seiten: [1]