Sub D_Listen()
'
' D_Listen Makro
' Makro erstellt am 03.11.04 von Basti
' Suchen nach "D E L T A" evt. noch Suchkriterien einstellen
Selection.Find.ClearFormatting
With Selection.Find
.Text = "D E L T A"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Do
' hier die Schleife verlassen, wenn kein "D E L T A" gefunden
If Not Selection.Find.Execute Then Exit Do
Selection.HomeKey Unit:=wdLine 'zur ersten Zeilenposition
Selection.MoveDown Unit:=wdLine, Count:=2, Extend:=wdExtend 'makiere die aktuelle und die nächste Zeile
Selection.Delete Unit:=wdCharacter, Count:=1 'lösche die markierten Zeilen
Loop
Selection.WholeStory
Selection.Find.ClearFormatting
With Selection.Font
.Name = ""
.Size = 9
End With
With ActiveDocument.Styles(wdStyleNormal).Font
If .NameFarEast = .NameAscii Then
.NameAscii = ""
End If
.NameFarEast = ""
End With
'With ActiveDocument.PageSetup
' .LineNumbering.Active = False
' .Orientation = wdOrientLandscape
' .TopMargin = CentimetersToPoints(2.03)
' .BottomMargin = CentimetersToPoints(2.03)
' .LeftMargin = CentimetersToPoints(2)
' .RightMargin = CentimetersToPoints(2.5)
' .Gutter = CentimetersToPoints(0)
' .HeaderDistance = CentimetersToPoints(1.27)
' .FooterDistance = CentimetersToPoints(1.27)
' .PageWidth = CentimetersToPoints(29.7)
' .PageHeight = CentimetersToPoints(21)
' .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
'End With
Selection.HomeKey Unit:=wdStory 'Gehe zu Pos1
Selection.Find.ClearFormatting 'Suchmenü öffnen
With Selection.Find 'Optionen für das Suchen
.Text = "PRT99" 'Suche Text "PRT99"
.Replacement.Text = "" 'kein Ersetzen
.Forward = True 'Suchrichtung vorwärts
.Wrap = wdFindContinue 'Suche wird am Anfang fortgesetzt wenn das Ende erreicht wurde und nicht am Anfang begonnen wurde
.Format = False 'keine Suche nach Formaten
.MatchCase = False 'Groß- und Kleinschreibung wird nicht berücksichtigt
.MatchWholeWord = False 'keine ganzen Worte
.MatchWildcards = False 'keine Platzhalter verwenden
.MatchSoundsLike = False 'keine ähnlichen Schreibweisen suchen
.MatchAllWordForms = False 'keine andere Wortform suchen (z. B. sitzen wird gesucht aber auch sitzend oder gesessen gefunden.
End With
Do
' hier die Schleife verlassen, wenn kein "PRT99" gefunden
If Not Selection.Find.Execute Then Exit Do
Selection.HomeKey Unit:=wdLine 'zur ersten Zeilenposition
Selection.MoveDown Unit:=wdLine, Count:=1, Extend:=wdExtend 'markiere die aktuelle Zeile
Selection.Delete Unit:=wdCharacter, Count:=1 'lösche die markierten Zeilen
Selection.InsertBreak Type:=wdPageBreak ' Seitenumbruch
Selection.MoveDown Unit:=wdLine, Count:=1 ' eine Zeile tiefer
Loop
Selection.HomeKey Unit:=wdStory 'Gehe zu Pos1
Selection.Find.ClearFormatting 'Suchmenü öffnen
With Selection.Find 'Optionen für das Suchen
.Text = "AEND??.\*" 'Suche Text "AEND??.*"
.Replacement.Text = "" 'kein Ersetzen
.Forward = True 'Suchrichtung vorwärts
.Wrap = wdFindContinue 'Suche wird am Anfang fortgesetzt wenn das Ende erreicht wurde und nicht am Anfang begonnen wurde
.Format = False 'keine Suche nach Formaten
.MatchCase = False 'Groß- und Kleinschreibung wird nicht berücksichtigt
.MatchWholeWord = False 'keine ganzen Worte
.MatchWildcards = True 'Platzhalter verwenden
.MatchSoundsLike = False 'keine ähnlichen Schreibweisen suchen
.MatchAllWordForms = False 'keine andere Wortform suchen (z. B. sitzen wird gesucht aber auch sitzend oder gesessen gefunden.
End With
Do
' hier die Schleife verlassen, wenn kein "AEND??" gefunden
If Not Selection.Find.Execute Then Exit Do
Selection.HomeKey Unit:=wdLine 'zur ersten Zeilenposition
Selection.MoveDown Unit:=wdLine, Count:=1, Extend:=wdExtend 'makiere die aktuelle Zeile
Selection.Delete Unit:=wdCharacter, Count:=1 'lösche die markierten Zeilen
Loop
Selection.HomeKey Unit:=wdStory
Call Groesse(Selection.Font.Size)
Selection.HomeKey Unit:=wdStory
Call Kopfzeile2
Call Umsetzung_Sonderzeichen_zu_Umlaute
Call Makro_Speichern4
MsgBox "Fertig"
End Sub
Sub Umsetzung_Sonderzeichen_zu_Umlaute()
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "|"
.Replacement.Text = "ö"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = True
.MatchWholeWord = 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 = "\"
.Replacement.Text = "Ö"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = True
.MatchWholeWord = 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 = "{"
.Replacement.Text = "ä"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = True
.MatchWholeWord = 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 = "["
.Replacement.Text = "Ä"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = True
.MatchWholeWord = 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 = "}"
.Replacement.Text = "ü"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = True
.MatchWholeWord = 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 = "]"
.Replacement.Text = "Ü"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = True
.MatchWholeWord = 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 = "~"
.Replacement.Text = "ß"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = True
.MatchWholeWord = False
.MatchWildcards = FalseMatchWholeWord
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
'
End Sub
Sub Kopfzeile2()
'
' Kopfzeile2 Makro
' Makro aufgezeichnet am 20.04.2005 von Basti
'
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 Then
ActiveWindow.ActivePane.View.Type = wdPrintView
End If
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter
Selection.TypeText Text:="Seite: "
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldPage
Selection.TypeText Text:=vbTab & "Datum: "
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldDate
ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
ActiveWindow.ActivePane.View.Zoom.PageFit = wdPageFitTextFit
End Sub
Sub Groesse(s1)
'
' Groesse Makro
' Makro aufgezeichnet am 17.01.2007 von Basti
'
Selection.WholeStory
Selection.Font.Size = s1 – 2
Sub Makro_Speichern4()
Dim DocName As String
Dim Pos As Integer
Dim Pfad As String
Dim Neu As Document
Set Alt = ActiveDocument
Documents.Add
Set Neu = ActiveDocument
Alt.Activate
With Selection.Find
.Text = "END UCOB-"
.Replacement.Text = "ß"
.Forward = True
.Wrap = wdFindContinue
End With
Selection.Find.Execute
Selection.HomeKey Unit:=wdLine
Selection.EndKey Unit:=wdLine, Extend:=wdExtend
Selection.Font.Size = Selection.Font.Size + 1
Selection.Font.Size = Selection.Font.Size + 1
Selection.Font.Size = Selection.Font.Size + 1
Selection.Font.Size = Selection.Font.Size + 1
Selection.Font.Color = wdColorRed
Selection.Find.ClearFormatting
Selection.MoveDown Unit:=wdLine, Count:=1, Extend:=wdExtend
Selection.Copy
Neu.Activate
Selection.Paste
Alt.Activate
With Selection.Find
.Text = "NUMBER OF"
.Replacement.Text = "ß"
.Forward = True
.Wrap = wdFindContinue
End With
Selection.Find.Execute
Selection.MoveDown Unit:=wdLine, Count:=3
Selection.HomeKey Unit:=wdLine
Selection.MoveDown Unit:=wdLine, Count:=3, Extend:=wdExtend
Selection.Font.Size = Selection.Font.Size + 1
Selection.Font.Size = Selection.Font.Size + 1
Selection.Font.Size = Selection.Font.Size + 1
Selection.Font.Color = wdColorRed
Selection.MoveDown Unit:=wdLine, Count:=1, Extend:=wdExtend
Selection.Copy
Neu.Activate
Selection.Paste
Alt.Activate
Selection.Find.Execute
With Selection.Find
.Text = "END LINK"
.Replacement.Text = "ß"
.Forward = True
.Wrap = wdFindContinue
End With
Selection.Find.Execute
Selection.HomeKey Unit:=wdLine
Selection.EndKey Unit:=wdLine, Extend:=wdExtend
Selection.Font.Size = Selection.Font.Size + 1
Selection.Font.Size = Selection.Font.Size + 1
Selection.Font.Size = Selection.Font.Size + 1
Selection.Font.Size = Selection.Font.Size + 1
Selection.Font.Color = wdColorRed
Selection.Find.ClearFormatting
Selection.MoveDown Unit:=wdLine, Count:=1, Extend:=wdExtend
Selection.Copy
Neu.Activate
Selection.Paste
Alt.Activate
DocName = ActiveDocument.FullName 'DocName mit dem aktiven Dateinamen belegen
Pos = InStrRev(DocName, ".") 'Gehe zum Letzten . von Hinten.'
DocName = Left(DocName, Pos - 1) 'Nehme ab dem . die folgenden 5 Zeichen in den Namen auf'
DocName = DocName & ".doc" '.doc-Erweiterung anhängen
ActiveDocument.SaveAs FileName:=DocName, FileFormat:=wdFormatDocument
Neu.Activate
End Sub