View Single Post
Old 03-12-2009, 03:54 PM   #6
Stenis
Connoisseur
Stenis has a complete set of Star Wars action figures.Stenis has a complete set of Star Wars action figures.Stenis has a complete set of Star Wars action figures.Stenis has a complete set of Star Wars action figures.
 
Posts: 65
Karma: 306
Join Date: May 2007
Location: Husum, Nf
Device: PRS505, Ipad
Hi, ich lasse über meine RTF's einmal das Word-Makro hier rüberlaufen und konvertiere dann in LRF über Calibre:

Das Makro entfernt die Seitenzahlen, entfernt diverse Umbrüche, Trennzeichen, setzt die Schriftart und Größe usw.

Danach kann man fast alles vernünftig lesen :-)


Sub Konvert()
'
' Makro1 Makro
' Makro aufgezeichnet am 04.06.2008 von mir
'

Selection.WholeStory
Selection.ParagraphFormat.Alignment = wdAlignParagraphJustify
Selection.Font.Name = "Times New Roman"
Selection.Font.Size = 10
Selection.ParagraphFormat.LineSpacing = LinesToPoints(1)

With Selection.Find
.Text = "^b"
.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 = "([a-z,])-[^13]"
.Replacement.Text = "\1"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute Replace:=wdReplaceAll

With Selection.Find
.Text = "([a-z])-([a-z])"
.Replacement.Text = "\1\2"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute Replace:=wdReplaceAll

With Selection.Find
.Text = "([0-9]@)[^13]"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute Replace:=wdReplaceAll

With Selection.Find
.Text = "([a-z,.;]) [^13]"
.Replacement.Text = "\1 "
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute Replace:=wdReplaceAll

' With Selection.Find
' .Text = "([a-z,;])[^13]"
' .Replacement.Text = "\1 "
' .Forward = True
' .Wrap = wdFindContinue
' .MatchWildcards = True
' End With
' Selection.Find.Execute Replace:=wdReplaceAll

With Selection.Find
.Text = "(.«)"
.Replacement.Text = "\1^p"
.Forward = True
.Wrap = wdFindContinue
.MatchWildcards = True
End With
Selection.Find.Execute Replace:=wdReplaceAll

With Selection.Find
.Text = "-^#-^p"
.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 = "-^#^#-^p"
.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 = "-^#^#^#-^p"
.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.ParagraphFormat
.LeftIndent = CentimetersToPoints(0)
.RightIndent = CentimetersToPoints(0)
End With

With ActiveDocument.PageSetup
.LineNumbering.Active = False
.Orientation = wdOrientPortrait
.TopMargin = CentimetersToPoints(0.4)
.BottomMargin = CentimetersToPoints(0.4)
.LeftMargin = CentimetersToPoints(0.4)
.RightMargin = CentimetersToPoints(0.4)
.Gutter = CentimetersToPoints(0)
.HeaderDistance = CentimetersToPoints(1.27)
.FooterDistance = CentimetersToPoints(1.27)
.PageWidth = CentimetersToPoints(16)
.PageHeight = CentimetersToPoints(21)
.FirstPageTray = wdPrinterDefaultBin
.OtherPagesTray = wdPrinterDefaultBin
.SectionStart = wdSectionNewPage
.OddAndEvenPagesHeaderFooter = False
.DifferentFirstPageHeaderFooter = False
.VerticalAlignment = wdAlignVerticalTop
.SuppressEndnotes = True
.MirrorMargins = False
.TwoPagesOnOne = False
.BookFoldPrinting = False
.BookFoldRevPrinting = False
.BookFoldPrintingSheets = 1
.GutterPos = wdGutterPosLeft
End With

End Sub
Stenis is offline   Reply With Quote