You are on page 1of 45

Allgemeines - 1

Sub Anfang_und_zwei_Seiten() Selection.HomeKey Unit:=wdStory With ActiveWindow.ActivePane.View.Zoom .PageColumns = 2 .PageRows = 1 End With End Sub

Sub seiteanwaehlen(seitennr) Selection.GoTo What:=wdGoToPage, Which:=wdGoToFirst, Count:=seitennr, name:="" Selection.Find.ClearFormatting With Selection.Find .Text = "" .Replacement.Text = "" .Forward = True .Wrap = wdFindContinue .Format = False .MatchCase = False .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With End Sub

Basic_Dateien - 1 Sub rand_1_cm() With ActiveDocument.PageSetup .LineNumbering.Active = False .Orientation = wdOrientPortrait .TopMargin = CentimetersToPoints(1) .BottomMargin = CentimetersToPoints(1) .LeftMargin = CentimetersToPoints(1) .RightMargin = CentimetersToPoints(1) .Gutter = CentimetersToPoints(0) .HeaderDistance = CentimetersToPoints(1.25) .FooterDistance = CentimetersToPoints(1.25) .PageWidth = CentimetersToPoints(21) .PageHeight = CentimetersToPoints(29.7) .FirstPageTray = wdPrinterDefaultBin .OtherPagesTray = wdPrinterDefaultBin .SectionStart = wdSectionNewPage .OddAndEvenPagesHeaderFooter = False .DifferentFirstPageHeaderFooter = False .VerticalAlignment = wdAlignVerticalTop .SuppressEndnotes = False .MirrorMargins = False End With End Sub '-------------------------------------------------------------------------------------------Sub courier9() Selection.WholeStory Selection.Font.Size = 9 Selection.Font.name = "Courier New" End Sub '-------------------------------------------------------------------------------------------Sub minirand() With ActiveDocument.PageSetup .LineNumbering.Active = False .Orientation = wdOrientPortrait .TopMargin = CentimetersToPoints(1) .BottomMargin = CentimetersToPoints(1) .LeftMargin = CentimetersToPoints(1) .RightMargin = CentimetersToPoints(1) .Gutter = CentimetersToPoints(0) .HeaderDistance = CentimetersToPoints(0) .FooterDistance = CentimetersToPoints(0) .PageWidth = CentimetersToPoints(21) .PageHeight = CentimetersToPoints(29.7) .FirstPageTray = wdPrinterDefaultBin .OtherPagesTray = wdPrinterDefaultBin .SectionStart = wdSectionNewPage .OddAndEvenPagesHeaderFooter = False .DifferentFirstPageHeaderFooter = False .VerticalAlignment = wdAlignVerticalTop .SuppressEndnotes = False .MirrorMargins = False End With End Sub '-------------------------------------------------------------------------------------------Sub layoutansicht() If ActiveWindow.View.SplitSpecial = wdPaneNone Then ActiveWindow.ActivePane.View.Type = wdPageView Else ActiveWindow.View.Type = wdPageView End If ActiveWindow.ActivePane.View.Zoom.PageFit = wdPageFitBestFit End Sub '-------------------------------------------------------------------------------------------Sub seite() 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 Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, Text:= _

Basic_Dateien - 2 "FILENAME \p \* Upper", PreserveFormatting:=True If Selection.HeaderFooter.IsHeader = True Then ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageFooter Else ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader End If NormalTemplate.AutoTextEntries("Seite X von Y").Insert Where:=Selection. _ Range ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument End Sub '-------------------------------------------------------------------------------------------Sub zweiseitenansicht() With ActiveWindow.ActivePane.View.Zoom .PageColumns = 2 .PageRows = 1 End With End Sub '-------------------------------------------------------------------------------------------Sub saveas_doc() Dim dateiname As String x = MsgBox("Speichern als Word Dokument?", vbYesNo, "Entscheide Dich nun") If x = vbOK Then dateiname = ActiveDocument.FullName i = Len(dateiname) dateiname = Left$(dateiname, i - 4) + ".doc" ActiveDocument.saveas FileName:=dateiname, FileFormat:= _ wdFormatDocument, LockComments:=False, Password:="", AddToRecentFiles:= _ False, WritePassword:="", ReadOnlyRecommended:=False, EmbedTrueTypeFonts:= _ False, SaveNativePictureFormat:=False, SaveFormsData:=False, _ SaveAsAOCELetter:=False MsgBox "Datei: " + dateiname + " gespeichert!" Else MsgBox "Aktion abgebrochen" End If End Sub '-------------------------------------------------------------------------------------------Sub allebasic() Call rand_1_cm Call courier_9 Call minirand Call layoutansicht Call seite Call zweiseitenansicht Call saveas End Sub '-------------------------------------------------------------------------------------------Sub openbasicfile() InputBox "" ChangeFileOpenDirectory "u:\ETC\mde\" dateiname = "" Documents.Open FileName:=dateiname, ConfirmConversions:=False, _ ReadOnly:=False, AddToRecentFiles:=False, PasswordDocument:="", _ PasswordTemplate:="", Revert:=False, WritePasswordDocument:="", _ WritePasswordTemplate:="", Format:=wdOpenFormatAuto End Sub

Dateiauswahl - 1 '-------------------------------------------------------------------------------------------Sub zzzzz() 'Declare a variable as a FileDialog object. 'Dim fd As FileDialog 'Create a FileDialog object as a File Picker dialog box. Set fd = Application.FileDialog(msoFileDialogFilePicker) 'Declare a variable to contain the path 'of each selected item. Even though the path is a String, 'the variable must be a Variant because For Each...Next 'routines only work with Variants and Objects. Dim vrtSelectedItem As Variant

'Use a With...End With block to reference the FileDialog object. With fd 'Use the Show method to display the File Picker dialog box and return the user's action. 'The user pressed the action button. If .Show = -1 Then 'Step through each string in the FileDialogSelectedItems collection. x = .SelectedItems.Count filetoopen = .SelectedItems(1) l = Len(filetoopen) textfilename = Left(filetoopen, l - 3) & "doc" For Each vrtSelectedItem In .SelectedItems 'vrtSelectedItem is a String that contains the path of each selected item. 'You can use any file I/O functions that you want to work with this path. 'This example simply displays the path in a message box. MsgBox "Folgende Datei wurde gewhlt:" & vbCrLf & "---------------------------------" & vbCrL f & vrtSelectedItem Next vrtSelectedItem 'The user pressed Cancel. Else MsgBox "Cancel gedrckt, oder den Dialog geschlossen, oder keine Auswahl getroffen" End If End With 'Set the object variable to Nothing. Set fd = Nothing Dim ar(1 To 100) As String ' Bildschirmdarstellung erstmal abschalten Application.ScreenUpdating = False 'filetoopen = "C:\Eigene Dateien\Bilder_Gerloff\FertII\fertig\bilder.txt" savefileas (textfilename)

Open filetoopen For Input As #1 ii = 1 Do While Not (EOF(1)) Line Input #1, st ar(ii) = st ii = ii + 1 Max = ii - 1 Loop Close #1 'For ii = 1 To 2 For ii = 1 To Max ' Selection.TypeText Text:=ar(ii) & vbCr ' hier die grafiken eintragen letzte = ii = Max grafik_einfuegen2 ar(ii), letzte Next ii Application.ScreenUpdating = True End Sub '--------------------------------------------------------------------------------------------

Sub grafik_einfuegen2(kname, letzte) ' Grafik einfgen Name usw. werden bergeben Selection.TypeParagraph Selection.TypeParagraph Selection.MoveLeft Unit:=wdCharacter, Count:=1 Selection.InlineShapes.AddPicture FileName:=kname, LinkToFile:=False, SaveWithDocument:=True

Dateiauswahl - 2 Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend ' Selection.MoveLeft Unit:=wdCharacter, Count:=1 ' Mae in cm Original yori = Selection.InlineShapes(1).Height * 2.54 / 72 xori = Selection.InlineShapes(1).Width * 2.54 / 72 vori = xori / yori ' Werte bx1 = by1 = ao1 = al1 = prop1 ' Werte bx2 = by2 = ao2 = al2 = prop2 ' Werte bx3 = by3 = ao3 = al3 = prop3 fr b1 18.7 14.2 3 9 = bx1 / by1 fr b1 bx1 17.2 1.6 al1 = bx2 / by2 fr b3 25.6 by1 ao1 2 = bx3 / by3

If vori >= prop1 Then ' querformat anpassen b3 If vori > prop3 Then 'quer vneu = bx3 / xori Else 'hoch vneu = by3 / yori End If ao = ao3 al = al3 Else 'hochformat anpassen If vori > prop2 Then 'quer vneu = bx2 / xori Else 'hoch vneu = by2 / yori End If ao = ao2 al = al2 End If xmax = xori * vneu / 2.54 * 72 ymax = yori * vneu / 2.54 * 72 Selection.InlineShapes(1).ConvertToShape Selection.ShapeRange.LockAspectRatio = msoTrue Selection.ShapeRange.Height = ymax Selection.ShapeRange.Width = xmax Selection.ShapeRange.RelativeHorizontalPosition = wdRelativeHorizontalPositionPage Selection.ShapeRange.RelativeVerticalPosition = wdRelativeVerticalPositionPage Selection.ShapeRange.Left = CentimetersToPoints(al) Selection.ShapeRange.Top = CentimetersToPoints(ao) Selection.ShapeRange.LockAnchor = False Selection.ShapeRange.WrapFormat.AllowOverlap = True Selection.ShapeRange.WrapFormat.Side = wdWrapBoth Selection.ShapeRange.WrapFormat.DistanceTop = CentimetersToPoints(0) Selection.ShapeRange.WrapFormat.DistanceBottom = CentimetersToPoints(0) Selection.ShapeRange.WrapFormat.DistanceLeft = CentimetersToPoints(0.32) Selection.ShapeRange.WrapFormat.DistanceRight = CentimetersToPoints(0.32) Selection.ShapeRange.WrapFormat.Type = 3 Selection.ShapeRange.ZOrder 5 Selection.MoveRight Unit:=wdCharacter, Count:=1 Selection.MoveRight Unit:=wdCharacter, Count:=1 Selection.TypeParagraph 'Abschnittswechsel einbauen

Dateiauswahl - 3

If Not (letzte) Then Selection.InsertBreak Type:=wdSectionBreakNextPage 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.HeaderFooter.LinkToPrevious = Not Selection.HeaderFooter. _ LinkToPrevious If Selection.HeaderFooter.IsHeader = True Then ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageFooter Else ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader End If Selection.HeaderFooter.LinkToPrevious = Not Selection.HeaderFooter. _ LinkToPrevious ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument Selection.TypeParagraph End If End Sub '-------------------------------------------------------------------------------------------Sub gtgtgt() Selection.InlineShapes.AddPicture FileName:="C:\Eigene Dateien\ipt-blau.jpg", LinkToFile:=False , SaveWithDocument:=True Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend Selection.InlineShapes(1).ConvertToShape Selection.ShapeRange.Fill.Visible = msoFalse Selection.ShapeRange.Fill.Transparency = 0# Selection.ShapeRange.Line.Weight = 0.75 Selection.ShapeRange.Line.DashStyle = msoLineSolid Selection.ShapeRange.Line.Style = msoLineSingle Selection.ShapeRange.Line.Transparency = 0# Selection.ShapeRange.Line.Visible = msoFalse Selection.ShapeRange.LockAspectRatio = msoTrue Selection.ShapeRange.Height = 283.45 Selection.ShapeRange.Width = 387.5 Selection.ShapeRange.PictureFormat.Brightness = 0.5 Selection.ShapeRange.PictureFormat.Contrast = 0.5 Selection.ShapeRange.PictureFormat.ColorType = msoPictureAutomatic Selection.ShapeRange.PictureFormat.CropLeft = 0# Selection.ShapeRange.PictureFormat.CropRight = 0# Selection.ShapeRange.PictureFormat.CropTop = 0# Selection.ShapeRange.PictureFormat.CropBottom = 0# Selection.ShapeRange.RelativeHorizontalPosition = _ wdRelativeHorizontalPositionPage Selection.ShapeRange.RelativeVerticalPosition = _ wdRelativeVerticalPositionPage Selection.ShapeRange.Left = CentimetersToPoints(5) Selection.ShapeRange.Top = CentimetersToPoints(4) Selection.ShapeRange.LockAnchor = False Selection.ShapeRange.WrapFormat.AllowOverlap = True Selection.ShapeRange.WrapFormat.Side = wdWrapBoth Selection.ShapeRange.WrapFormat.DistanceTop = CentimetersToPoints(0) Selection.ShapeRange.WrapFormat.DistanceBottom = CentimetersToPoints(0) Selection.ShapeRange.WrapFormat.DistanceLeft = CentimetersToPoints(0.32) Selection.ShapeRange.WrapFormat.DistanceRight = CentimetersToPoints(0.32) Selection.ShapeRange.WrapFormat.Type = 3 Selection.ShapeRange.ZOrder 5 End Sub '-------------------------------------------------------------------------------------------Sub aendern() ' Fr Folienlayout Fert II angelagt. ' Evtll. mu spter noch mal hand angelegt werden. ' Mae in cm Original yori = Selection.InlineShapes(1).Height * 2.54 / 72 xori = Selection.InlineShapes(1).Width * 2.54 / 72 ' ' yori = Selection.ShapeRange.Height * 2.54 / 72 xori = Selection.ShapeRange.Width * 2.54 / 72 vori = xori / yori

Dateiauswahl - 4 ' Werte bx1 = by1 = ao1 = al1 = prop1 ' Werte bx2 = by2 = ao2 = al2 = prop2 ' Werte bx3 = by3 = ao3 = al3 = prop3 fr b1 18.7 14.2 3 9 = bx1 / by1 fr b1 bx1 17.2 1.6 al1 = bx2 / by2 fr b3 25.6 by1 ao1 2 = bx3 / by3

If vori >= prop1 Then ' querformat anpassen b3 If vori > prop3 Then 'quer vneu = bx3 / xori Else 'hoch vneu = by3 / yori End If ao = ao3 al = al3 Else 'hochformat anpassen If vori > prop2 Then 'quer vneu = bx2 / xori Else 'hoch vneu = by2 / yori End If ao = ao2 al = al2 End If xmax = xori * vneu / 2.54 * 72 ymax = yori * vneu / 2.54 * 72 Selection.InlineShapes(1).ConvertToShape Selection.ShapeRange.LockAspectRatio = msoTrue Selection.ShapeRange.Height = ymax Selection.ShapeRange.Width = xmax Selection.ShapeRange.RelativeHorizontalPosition = wdRelativeHorizontalPositionPage Selection.ShapeRange.RelativeVerticalPosition = wdRelativeVerticalPositionPage Selection.ShapeRange.Left = CentimetersToPoints(al) Selection.ShapeRange.Top = CentimetersToPoints(ao) Selection.ShapeRange.LockAnchor = False Selection.ShapeRange.WrapFormat.AllowOverlap = True Selection.ShapeRange.WrapFormat.Side = wdWrapBoth Selection.ShapeRange.WrapFormat.DistanceTop = CentimetersToPoints(0) Selection.ShapeRange.WrapFormat.DistanceBottom = CentimetersToPoints(0) Selection.ShapeRange.WrapFormat.DistanceLeft = CentimetersToPoints(0.32) Selection.ShapeRange.WrapFormat.DistanceRight = CentimetersToPoints(0.32) Selection.ShapeRange.WrapFormat.Type = 3 Selection.ShapeRange.ZOrder 5 ActiveWindow.ActivePane.View.ShowAll = Not ActiveWindow.ActivePane.View.ShowAll End Sub '-------------------------------------------------------------------------------------------Sub savefileas(ByVal neuername) ' aktuell geffnetes dokument wird im gleichen vezeichnis unter anderem namen gespeichert ActiveDocument.saveas FileName:=neuername, FileFormat:=wdFormatDocument, _ LockComments:=False, Password:="", AddToRecentFiles:=True, WritePassword _ :="", ReadOnlyRecommended:=False, EmbedTrueTypeFonts:=False, _ SaveNativePictureFormat:=False, SaveFormsData:=False, SaveAsAOCELetter:= _ False

Dateiauswahl - 5 End Sub '-------------------------------------------------------------------------------------------'--------------------------------------------------------------------------------------------

dokinfos - 1

Function ak_abschnitt() As Integer ' gibt den aktuellen Abschnitt an, in dem der Cursor steht, oder wo etwas markiert ist ak_abschnitt = Selection.Information(wdActiveEndSectionNumber) End Function '----------------------------------------------------------------------------------Function ak_seite_im_abschnitt() As Integer ' gibt die Seitennr im aktuellen Abschnitt an, in dem der Cursor steht, oder wo etwas markiert ist ak_seite_im_abschnitt = Selection.Information(wdActiveEndAdjustedPageNumber) End Function '----------------------------------------------------------------------------------Function ak_seite() As Integer ' gibt die aktuelle Seite an, in dem der Cursor steht, oder wo etwas markiert ist ak_seite = Selection.Information(wdActiveEndPageNumber) End Function '----------------------------------------------------------------------------------Function ak_max_seiten() As Integer ' gibt die gesamtzahl der Seiten im Dokument an ak_max_seiten = Selection.Information(wdNumberOfPagesInDocument) End Function '-----------------------------------------------------------------------------------

Drucken - 1 Sub drucker() ' Ein Eingabedialog soll fragen, welcher Drucker Standarddrucker sein soll Dim s1 As String Dim s2 As String Dim s3 As String Dim s4 As String Dim s5 As String Dim s6 As String Dim x As Integer Dim xpos As Integer Dim ypos As Integer Dim Titel As String Dim prompt As String Dim default As Integer ' constants xpos = 5000 ypos = 3000 ' 7.3.06 ' ActivePrinter = "HP OfficeJet G Series" ' ActivePrinter = "\\rzds003\Kyocera_FS-1750_(KPDL-2)_ipt_r116" ' ActivePrinter = "HP OfficeJet G Series Fax" ' ActivePrinter = "\\rzds003\HP DesignJet 750C+ (E/A0) by HP_ipt_R115-Diplomarbeitsraum" ' ActivePrinter = "Adobe PDF" Titel = s1 = "1 s2 = "2 s3 = "3 s4 = "4 s5 = "5 s6 = "6 "Auswahl des Standarddruckers" = HP OfficeJet G Series" = \\rzds003\Kyocera_FS-1750_(KPDL-2)_ipt_r116" = HP OfficeJet G Series Fax" = HP DesignJet 750C+ R.115" = Adobe PDF " = Nix "

prompt = s1 & vbCrLf & s2 & vbCrLf & s3 & vbCrLf & s4 & vbCrLf & s5 & vbCrLf & s6 default = 1 x = 0 While ((x <> 1) And (x <> 2) And (x <> 3) And (x <> 4) And (x <> 5) And (x <> 6)) x = InputBox(prompt, Titel, default, xpos, ypos) If x <> 1 And x <> 2 And x <> 3 And x <> 4 And x <> 5 And x <> 6 Then MsgBox "Fehleingabe !!" Wend If x = 1 Then ActivePrinter = "HP OfficeJet G Series" ElseIf x = 2 Then ActivePrinter = "\\rzds003\Kyocera_FS-1750_(KPDL-2)_ipt_r116" ElseIf x = 3 Then ActivePrinter = "HP OfficeJet G Series Fax" ElseIf x = 4 Then ActivePrinter = "\\rzds003\HP DesignJet 750C+ (E/A0) by HP_ipt_R115-Diplomarbeitsraum" ElseIf x = 5 Then ActivePrinter = "Adobe PDF" ElseIf x = 6 Then ActivePrinter = "\\rzds003\Kyocera_FS-1750_(KPDL-2)_ipt_r116"

End If End Sub '-------------------------------------------------------------------------------------------Sub Drucke_aktuelle_seite() Application.PrintOut FileName:="", Range:=wdPrintCurrentPage, Item:= _ wdPrintDocumentContent, Copies:=1, Pages:="", PageType:=wdPrintAllPages, _ Collate:=False, Background:=False, PrintToFile:=False End Sub '-------------------------------------------------------------------------------------------Sub Dr_akt_plus() s_anz = InputBox("Bitte die Zahl der zu druckenden Seiten ab der aktuellen angeben :", "Anzahl S eiten", 1) s_anz = Trim(s_anz) se_anz = Val(s_anz) If se_anz >= 1 Then Drucke_aktuelle_seite se_anz = se_anz - 1 For i = 1 To se_anz Call zur_naechsten_seite_wechseln Call Drucke_aktuelle_seite Next i Else MsgBox "Falsche Eingabe"

Drucken - 2 End If End Sub Sub zur_naechsten_seite_wechseln() Selection.GoTo What:=wdGoToPage, Which:=wdGoToNext, Count:=1, name:="" End Sub '-------------------------------------------------------------------------------------------Sub Drucke_aktuellen_abschnitt() ' abschnitt fragen, bis es automatisch geht 'x = AuswInfo(2) 'Selection.Collapse Direction:=wdCollapseStart 'xxx = ActiveDocument.Content.Information(wdActiveEndSectionNumber) 'ab = Application.ActiveDocument.Sections(ActiveSection) x = 1 abschnitt = InputBox("Bitte Nr. des Abschnittes angeben :", "Abschnittseingabe", 1) abschnitt = Trim(abschnitt) absnr = Val(abschnitt) If absnr > 0 Then druckbereich = "s" & abschnitt Application.PrintOut FileName:="", Range:=wdPrintRangeOfPages, Item:= _ wdPrintDocumentContent, Copies:=1, Pages:=druckbereich, PageType:= _ wdPrintAllPages, ManualDuplexPrint:=False, Collate:=False, Background:= _ False, PrintToFile:=False, PrintZoomColumn:=0, PrintZoomRow:=0, _ PrintZoomPaperWidth:=0, PrintZoomPaperHeight:=0 Else MsgBox "Falsche Eingabe" End If End Sub '-------------------------------------------------------------------------------------------Sub Drucke_aktuelle_seite_mehrfach() anz = InputBox("Bitte Anzahl der Kopien fr aktuelle Seite eingeben", "Kopienanzahl", 2) If anz > 0 Then Application.PrintOut FileName:="", Range:=wdPrintCurrentPage, Item:= _ wdPrintDocumentContent, Copies:=anz, Pages:="", PageType:=wdPrintAllPages, _ Collate:=False, Background:=False, PrintToFile:=False End If End Sub '-------------------------------------------------------------------------------------------Sub abschnitt_drucken12() ' abschnitt fragen abschnitt = InputBox("Bitte Nr. des Abschnittes angeben :", "Abschnittseingabe", 1) abschnitt = Trim(abschnitt) absnr = Val(abschnitt) If absnr > 0 Then druckbereich = "p1s" & abschnitt & "-p2s" & abschnitt Application.PrintOut FileName:="", Range:=wdPrintRangeOfPages, Item:= _ wdPrintDocumentContent, Copies:=1, Pages:=druckbereich, PageType:= _ wdPrintAllPages, ManualDuplexPrint:=False, Collate:=False, Background:= _ False, PrintToFile:=False, PrintZoomColumn:=0, PrintZoomRow:=0, _ PrintZoomPaperWidth:=0, PrintZoomPaperHeight:=0 Else MsgBox "Falsche Eingabe" End If End Sub '-------------------------------------------------------------------------------------------Sub abschnitt_drucken1() anz = Application.ActiveDocument.Sections.Count - 1 For absnr = 1 To anz druckbereich = "p1s" & absnr & "-p1s" & absnr Application.PrintOut FileName:="", Range:=wdPrintRangeOfPages, Item:= _ wdPrintDocumentContent, Copies:=1, Pages:=druckbereich, PageType:= _ wdPrintAllPages, ManualDuplexPrint:=False, Collate:=False, Background:= _ False, PrintToFile:=False, PrintZoomColumn:=0, PrintZoomRow:=0, _ PrintZoomPaperWidth:=0, PrintZoomPaperHeight:=0 Next absnr End Sub '-------------------------------------------------------------------------------------------Sub abschnitte_zaehlen() y = Application.Selection.Characters.Count anz = Application.ActiveDocument.Sections.Count x = Application.ActiveDocument.Sections.Item(6)

Drucken - 3 MsgBox anz End Sub '-------------------------------------------------------------------------------------------Sub block_drucken(seite1, seite2) druckbereich = "P" & Trim(Str(seite1)) & "-P" & Trim(Str(seite2)) Application.PrintOut FileName:="", Range:=wdPrintRangeOfPages, Item:= _ wdPrintDocumentContent, Copies:=1, Pages:=druckbereich, PageType:= _ wdPrintAllPages, ManualDuplexPrint:=False, Collate:=False, Background:= _ False, PrintToFile:=False, PrintZoomColumn:=0, PrintZoomRow:=0, _ PrintZoomPaperWidth:=0, PrintZoomPaperHeight:=0

End Sub Sub alle_Bloecke_drucken() x = InputBox("Bitte die Anzahl der Gesamtseiten eingeben", "", 240) y = InputBox("Bitte die Anzahl der Seiten pro Druck eingeben", "", 4) If x > 0 And y > 0 Then If x >= y Then anzg = x \ y anze = x Mod y If anze > 0 Then anzg = anzg + 1 For ii = 1 To anzg s1 = (ii - 1) * y + 1 s2 = s1 + y - 1 Call block_drucken(s1, s2) Next ii Else MsgBox "Geht nicht, Anzahl Gesamtseiten mu grsser sein als pro Block" End If End If End Sub '-------------------------------------------------------------------------------------------Sub abschnitt_drucken() ' abschnitt fragen abschnitt = ak_abschnitt 'abschnitt = InputBox("Bitte Nr. des Abschnittes angeben :", "Abschnittseingabe", 1) 'abschnitt = Trim(abschnitt) absnr = Val(abschnitt) If absnr > 0 Then druckbereich = "s" & abschnitt & "-s" & abschnitt Application.PrintOut FileName:="", Range:=wdPrintRangeOfPages, Item:= _ wdPrintDocumentContent, Copies:=1, Pages:=druckbereich, PageType:= _ wdPrintAllPages, ManualDuplexPrint:=False, Collate:=False, Background:= _ False, PrintToFile:=False, PrintZoomColumn:=0, PrintZoomRow:=0, _ PrintZoomPaperWidth:=0, PrintZoomPaperHeight:=0 Else MsgBox "Falsche Eingabe" End If End Sub '--------------------------------------------------------------------------------------------

fkl - 1 Sub format_aufgabe() Selection.MoveDown Unit:=wdLine, Count:=1, Extend:=wdExtend Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend Selection.Style = ActiveDocument.Styles("Aufgabe") End Sub '--------------------------------------------------------------------Sub tabellen_rand() With Selection.Tables(1) .TopPadding = CentimetersToPoints(0) .BottomPadding = CentimetersToPoints(0) .LeftPadding = CentimetersToPoints(0.1) .RightPadding = CentimetersToPoints(0) .Spacing = 0 .AllowPageBreaks = True .AllowAutoFit = False End With End Sub '--------------------------------------------------------------------Sub tabtest() 'x = Selection.Application.ActiveDocument.Tables.Count 'x = Selection.Application.ActiveDocument.Tables.Count 'x = Selection.Tables(1) 'ActiveDocument.Tables(1).Select 'x = ActiveDocument.Tables(1).Columns.Count x = ActiveDocument.Tables.Count For t = 1 To x ActiveDocument.Tables(t).Select c = ActiveDocument.Tables(t).Columns.Count 'ActiveDocument.Tables(t).Columns(c). If c > 1 Then 'ActiveDocument.Tables(t).Columns(1).Delete Selection.Tables(1).PreferredWidthType = wdPreferredWidthPoints Selection.Tables(1).PreferredWidth = CentimetersToPoints(18) End If Next t 'ActiveDocument.Tables(1).Select 'Selection.Copy 'MsgBox x End Sub '--------------------------------------------------------------------Sub sunde() Selection.Cut Selection.Delete Unit:=wdCharacter, Count:=1 Selection.Delete Unit:=wdCharacter, Count:=1 Selection.MoveRight Unit:=wdWord, Count:=1 Selection.TypeText Text:=" " Selection.Paste Selection.MoveRight Unit:=wdCharacter, Count:=1 Selection.TypeText Text:=vbTab & "Thema" & vbTab & "." Selection.HomeKey Unit:=wdLine Selection.EndKey Unit:=wdLine, Extend:=wdExtend Selection.Style = ActiveDocument.Styles("berschrift 1") Selection.HomeKey Unit:=wdLine End Sub '--------------------------------------------------------------------Sub alle_textfelder_ohne_rahmen() For Each sh In ActiveDocument sh.ShapeRange.Fill.Visible = msoFalse sh.ShapeRange.Fill.Solid sh.ShapeRange.Fill.Transparency = 0# End Sub '--------------------------------------------------------------------Sub sunde2() Selection.Cut Selection.Delete Unit:=wdCharacter, Count:=1 Selection.Delete Unit:=wdCharacter, Count:=1 Selection.MoveRight Unit:=wdWord, Count:=1 Selection.TypeText Text:=" " Selection.Paste Selection.MoveRight Unit:=wdCharacter, Count:=1 Selection.TypeText Text:=vbTab & "Thema" & vbTab & "." Selection.HomeKey Unit:=wdLine Selection.EndKey Unit:=wdLine, Extend:=wdExtend Selection.Style = ActiveDocument.Styles("berschrift 1") Selection.HomeKey Unit:=wdLine

fkl - 2 End Sub '--------------------------------------------------------------------Sub tab_breite() x = ActiveDocument.Tables.Count For t = 1 To x ActiveDocument.Tables(t).Select Selection.Tables(1).PreferredWidthType = wdPreferredWidthPoints Selection.Tables(1).PreferredWidth = CentimetersToPoints(18) Next t End Sub '--------------------------------------------------------------------Sub formeln_raus() 'x = ActiveDocument End Sub '--------------------------------------------------------------------'--------------------------------------------------------------------'--------------------------------------------------------------------'--------------------------------------------------------------------'---------------------------------------------------------------------

Grafik_Auto - 1 '-------------------------------------------------------------------------------------------Sub hochformat_rand(links, rechts, oben, unten) ' Neu fr einfgen von Bildern mit vorgebbaren Rndern With ActiveDocument.PageSetup .LineNumbering.Active = False .Orientation = wdOrientPortrait .TopMargin = CentimetersToPoints(oben) .BottomMargin = CentimetersToPoints(unten) .LeftMargin = CentimetersToPoints(links) .RightMargin = CentimetersToPoints(rechts) .Gutter = CentimetersToPoints(0) .HeaderDistance = CentimetersToPoints(1) .FooterDistance = CentimetersToPoints(1) .PageWidth = CentimetersToPoints(21) .PageHeight = CentimetersToPoints(29.7) .FirstPageTray = wdPrinterAutomaticSheetFeed .OtherPagesTray = wdPrinterAutomaticSheetFeed .SectionStart = wdSectionNewPage .OddAndEvenPagesHeaderFooter = False .DifferentFirstPageHeaderFooter = False .VerticalAlignment = wdAlignVerticalTop .SuppressEndnotes = False .MirrorMargins = False .TwoPagesOnOne = False .GutterPos = wdGutterPosLeft End With End Sub '--------------------------------------------------------------------------------------------

Sub grafik_einfuegen(kname, dname, beschriftung) ' Grafik einfgen Name usw. werden bergeben Selection.TypeParagraph Selection.InlineShapes.AddPicture FileName:=kname, LinkToFile:=False, SaveWithDocument:=True ' Grafik anpassen form = grafik_auf_seitengroesse If beschriftung = 1 Then Selection.InsertCaption Label:="Abbildung", TitleAutoText:="EinfgenBeschriftung2", Title:=UC ase(dname), Position:=wdCaptionPositionBelow Else Selection.MoveRight Unit:=wdCharacter, Count:=1 End If Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend ' Seitenumbruch einfgen und Seitenformat entsprechend der Grafik anpassen Call seitenformat(form) Selection.MoveRight Unit:=wdCharacter, Count:=1 End Sub '-------------------------------------------------------------------------------------------Function grafik_auf_seitengroesse() As Boolean Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend 'Selection.MoveLeft Unit:=wdCharacter, Count:=1 ' Mae in cm Original yori = Selection.InlineShapes(1).Height * 2.54 / 72 xori = Selection.InlineShapes(1).Width * 2.54 / 72 vori = xori / yori ' Maximale Grssen fr Hochformat xm1 = 18 ym1 = 25.5 ' Maximale Grssen fr Querformat xm2 = 26.5 ym2 = 16 If vori > xm1 / ym2 Then ' querformat anpassen If vori > xm2 / ym2 Then vneu = xm2 / xori Else vneu = ym2 / yori End If grafik_auf_seitengroesse = False Else 'hochformat anpassen If vori > xm1 / ym1 Then vneu = xm1 / xori Else vneu = ym1 / yori

Grafik_Auto - 2 End If grafik_auf_seitengroesse = True End If xmax = xori * vneu / 2.54 * 72 ymax = yori * vneu / 2.54 * 72 Selection.InlineShapes(1).LockAspectRatio = msoTrue Selection.InlineShapes(1).Width = xmax Selection.InlineShapes(1).Height = ymax Selection.MoveRight Unit:=wdCharacter, Count:=1 Selection.TypeParagraph End Function '-------------------------------------------------------------------------------------------Sub seitenformat(form) Selection.TypeParagraph Selection.TypeParagraph 'Abschnittswechsel einbauen Selection.InsertBreak Type:=wdSectionBreakNextPage ' und wieder zurck zum letzten Abschnitt Selection.MoveLeft Unit:=wdCharacter, Count:=1 ' Seitenformatierung aufgrund der Bildparameter breite und lnge zufuhr = 0 If form = True Then hochform zufuhr, 1 Else querform zufuhr, 1 ' und wieder zurck zum nchsten Abschnitt Selection.MoveRight Unit:=wdCharacter, Count:=1 End If End Sub '-------------------------------------------------------------------------------------------Sub querform(zufuhr, dr) ' Querformat With Selection.PageSetup .LineNumbering.Active = False .Orientation = wdOrientLandscape .TopMargin = CentimetersToPoints(1.4) .BottomMargin = CentimetersToPoints(1.4) .LeftMargin = CentimetersToPoints(1.4) .RightMargin = CentimetersToPoints(1.4) .Gutter = CentimetersToPoints(0) .HeaderDistance = CentimetersToPoints(1) .FooterDistance = CentimetersToPoints(1) .PageWidth = CentimetersToPoints(29.7) .PageHeight = CentimetersToPoints(21) If zufuhr = 0 Then If dr = 0 Then ' Gilt fr KPDL2 .FirstPageTray = wdPrinterAutomaticSheetFeed .OtherPagesTray = wdPrinterAutomaticSheetFeed Else ' Gilt fr PCL .FirstPageTray = wdPrinterDefaultBin .OtherPagesTray = wdPrinterDefaultBin End If Else If dr = 0 Then ' Gilt fr KPDL2 .FirstPageTray = 261 .OtherPagesTray = 261 Else ' Gilt fr PCL .FirstPageTray = wdPrinterSmallFormatBin .OtherPagesTray = wdPrinterSmallFormatBin End If End If .SectionStart = wdSectionNewPage .OddAndEvenPagesHeaderFooter = False .DifferentFirstPageHeaderFooter = False .VerticalAlignment = wdAlignVerticalTop .SuppressEndnotes = False .MirrorMargins = False .TwoPagesOnOne = False .GutterPos = wdGutterPosLeft End With End Sub

Grafik_Auto - 3 '-------------------------------------------------------------------------------------------Sub hochform(zufuhr, dr) ' Hochformat With Selection.PageSetup .LineNumbering.Active = False .Orientation = wdOrientPortrait .TopMargin = CentimetersToPoints(1.4) .BottomMargin = CentimetersToPoints(1.4) .LeftMargin = CentimetersToPoints(1.4) .RightMargin = CentimetersToPoints(1.4) .Gutter = CentimetersToPoints(0) .HeaderDistance = CentimetersToPoints(1) .FooterDistance = CentimetersToPoints(1) .PageWidth = CentimetersToPoints(21) .PageHeight = CentimetersToPoints(29.7) If zufuhr = 0 Then If dr = 0 Then ' Gilt fr KPDL2 .FirstPageTray = wdPrinterAutomaticSheetFeed .OtherPagesTray = wdPrinterAutomaticSheetFeed Else ' Gilt fr PCL .FirstPageTray = wdPrinterDefaultBin .OtherPagesTray = wdPrinterDefaultBin End If Else If dr = 0 Then ' Gilt fr KPDL2 .FirstPageTray = 261 .OtherPagesTray = 261 Else ' Gilt fr PCL .FirstPageTray = wdPrinterSmallFormatBin .OtherPagesTray = wdPrinterSmallFormatBin End If End If .SectionStart = wdSectionNewPage .OddAndEvenPagesHeaderFooter = False .DifferentFirstPageHeaderFooter = False .VerticalAlignment = wdAlignVerticalTop .SuppressEndnotes = False .MirrorMargins = False .TwoPagesOnOne = False .GutterPos = wdGutterPosLeft End With End Sub '-------------------------------------------------------------------------------------------Sub restweg() ' Letzten leeren Abschnitt entfernen Selection.MoveLeft Unit:=wdCharacter, Count:=1 If Selection.PageSetup.Orientation = wdOrientLandscape Then Selection.Delete Unit:=wdCharacter, Count:=5 Selection.PageSetup.Orientation = wdOrientLandscape Selection.PageSetup.PageWidth = CentimetersToPoints(29.7) Selection.PageSetup.PageHeight = CentimetersToPoints(21) Else Selection.Delete Unit:=wdCharacter, Count:=5 End If End Sub '-------------------------------------------------------------------------------------------Sub zufuhr_umstellen(zufuhr, dr) If Selection.PageSetup.PageWidth = CentimetersToPoints(21) Then hochform zufuhr, 0 Else querform zufuhr, 0 End If End Sub '-------------------------------------------------------------------------------------------Sub folien_und_papier_druck() seiteanwaehlen (1) startseite = InputBox("Bitte Startseite zum Drucken eingeben", "Startseite", 1) endeseiten = InputBox("Bitte Letzte Seite zum Drucken eingeben", "Letzte Seite", 1) dru = InputBox("Bitte Drucker angeben" & vbCrLf & "0=KPDL" & vbCrLf & "1=PCL", "Druckerauswahl", 1)

Grafik_Auto - 4 For si = startseite To endeseiten seiteanwaehlen (si) zufuhr_umstellen 0, dru Drucke_aktuelle_seite zufuhr_umstellen 1, dru Drucke_aktuelle_seite 'MsgBox "Bin auf seite: " & Str(si) Next si End Sub '-------------------------------------------------------------------------------------------Sub Alle_Grafiken_aus_einem_Ordner_einfuegen() Dim dir As String Dim dir1 As String Dim dir2 As String Dim fs, f, file, sf, gf, gf1 ' Bildschirmdarstellung erstmal abschalten Application.ScreenUpdating = False ' Randeinstellung allseitig auf 1,4 cm setzen ein = "Seitenrnder" ein = ein & "------------------" ein = ein & "Alle Seiten 0,2mm" ein = ein & "oder" ein = ein & "l+r=1,4 o+u=1,2" sr = InputBox(ein, "Seitenrnder auswhlen", 0) If sr = 0 Then links = 0.2 rechts = 0.2 oben = 0.2 unten = 0.2 Else links = 1.4 rechts = 1.4 oben = 1.2 unten = 1.2 End If Call hochformat_rand(links, rechts, oben, unten) ' Bilderverzeichnis auswhlen msg = "Bilderverzeichnis auswhlen" ordner = getdirectory("Bilderverzeichnis auswhlen") ' Alle grafiken einfgen und Seite formatieren Set fs = CreateObject("Scripting.FileSystemObject") Set f = fs.GetFolder(ordner) Set gf = f.Files For Each fil In gf Datei = fil.Path ext = UCase(fs.getextensionname(fil.Path)) If ext = "JPG" Then dname = fil.name ' Grafik und Abschnittswechsel einfgen und grafik formatieren bildunter = 0 grafik_einfuegen Datei, dname, bildunter End If Next Call restweg ' Bildschirmdarstellung wieder einschalten Call Anfang_und_zwei_Seiten Application.ScreenUpdating = True End Sub '-------------------------------------------------------------------------------------------Sub Alle_Grafiken_einfuegen_aus_Textdatei() Dim dir As String Dim dir1 As String Dim dir2 As String Dim fs, f, file, sf, gf, gf1 Dim ein As String ' Bildschirmdarstellung erstmal abschalten Application.ScreenUpdating = False ' Randeinstellung allseitig auf 1,4 cm setzen ein = "Seitenrnder" ein = ein & "------------------" ein = ein & "Alle Seiten 0,2mm" ein = ein & "oder" ein = ein & "l+r=1,4 o+u=1,2" sr = InputBox(ein, "Seitenrnder auswhlen", 0)

Grafik_Auto - 5 If sr = 0 Then links = 0.2 rechts = 0.2 oben = 0.2 unten = 0.2 Else links = 1.4 rechts = 1.4 oben = 1.2 unten = 1.2 End If Call hochformat_rand(links, rechts, oben, unten) ' Bilderverzeichnis auswhlen msg = "Verzeichnis der Textdatei auswhlen" ordner = getdirectory("Verzeichnis der Textdatei auswhlen") ' Alle grafiken einfgen und Seite formatieren ein = "Test.txt" ein = InputBox("", "", ein) ein = ordner & "\" & ein Open ein For Input As #1 Do While Not EOF(1) Line Input #1, Datei dname = Datei ' Grafik und Abschnittswechsel einfgen und grafik formatieren bildunter = 0 grafik_einfuegen Datei, dname, bildunter Loop Close #1 Call restweg ' Bildschirmdarstellung wieder einschalten Call Anfang_und_zwei_Seiten Application.ScreenUpdating = True End Sub '-------------------------------------------------------------------------------------------'-------------------------------------------------------------------------------------------'--------------------------------------------------------------------------------------------

Herber - 1 '##################################################################### '# Funktion zum Aufruf der Verzeichnisstruktur # '# Autor: Hans W. Herber - hans@herber.de - http://www.herber.de # '# Erstellt im Februar 2001 # '# ----------------------------------------------------------------- # '# Optionaler Parameter msg = anzuzeigende Dialogberschrift # '##################################################################### Public Type BROWSEINFO hOwner As Long pidlRoot As Long pszDisplayName As String lpszTitle As String ulFlags As Long lpfn As Long lParam As Long iImage As Long End Type Declare Function SHGetPathFromIDList Lib "shell32.dll" _ Alias "SHGetPathFromIDListA" (ByVal pidl As Long, _ ByVal pszPath As String) As Long Declare Function SHBrowseForFolder Lib "shell32.dll" _ Alias "SHBrowseForFolderA" (lpBrowseInfo As BROWSEINFO) As Long '-------------------------------------------------------------------------------------------Sub DirAuswahl() Dim msg As String Dim ordner As String msg = "Whlen Sie bitte einen Ordner aus:" ordner = getdirectory(msg) MsgBox ordner End Sub Function getdirectory(Optional msg) Dim bInfo As BROWSEINFO Dim Path As String Dim r As Long, x As Long, pos As bInfo.pidlRoot = 0& If IsMissing(msg) Then bInfo.lpszTitle = "Whlen Sie Else bInfo.lpszTitle = msg End If bInfo.ulFlags = &H1 x = SHBrowseForFolder(bInfo) Path = Space$(512) r = SHGetPathFromIDList(ByVal x, If r Then pos = InStr(Path, Chr$(0)) getdirectory = Left(Path, pos Else getdirectory = "" End If End Function As String Integer bitte einen Ordner aus."

ByVal Path) - 1)

konvert_to_pdf - 1 '-------------------------------------------------------------------------------------------Sub Alle_Grafiken_einfuegen_aus_Textdatei() Dim dir As String Dim dir1 As String Dim dir2 As String Dim fs, f, file, sf, gf, gf1 Dim ein As String ' Bildschirmdarstellung erstmal abschalten Application.ScreenUpdating = False ' Verzeichnis auswhlen msg = "Verzeichnis der Textdatei auswhlen" ordner = getdirectory("Verzeichnis der Textdatei auswhlen") ein = "Test.txt" ein = InputBox("", "", ein) ein = ordner & "\" & ein Open ein For Input As #1 Do While Not EOF(1) Line Input #1, Datei eine_pdf (Datei) Loop Close #1 ' Bildschirmdarstellung wieder einschalten Application.ScreenUpdating = True End Sub '-------------------------------------------------------------------------------------------Sub eine_pdf(dname) ' ' eine_pdf Makro ' Makro aufgezeichnet am 23.02.2005 von ipt ' ttt = dname nnn = Len(dname) - 4 'zzz = "D:\_pdf\" & Left(dname, nnn) & ".pdf" zzz = Left(dname, nnn) & ".pdf" 'MsgBox zzz ' ChangeFileOpenDirectory "Q:\PROFESS\GERLOFF\ZspL\" Documents.Open FileName:=dname, ConfirmConversions:=True, _ ReadOnly:=False, AddToRecentFiles:=False, PasswordDocument:="", _ PasswordTemplate:="", Revert:=False, WritePasswordDocument:="", _ WritePasswordTemplate:="", Format:=wdOpenFormatAuto, XMLTransform:="" ActivePrinter = "Adobe PDF" Application.PrintOut FileName:="", Range:=wdPrintAllDocument, Item:= _ wdPrintDocumentContent, Copies:=1, Pages:="", PageType:=wdPrintAllPages, _ ManualDuplexPrint:=False, Collate:=False, Background:=False, PrintToFile _ :=False, PrintZoomColumn:=0, PrintZoomRow:=0, PrintZoomPaperWidth:=0, _ PrintZoomPaperHeight:=0 ActiveWindow.Close End Sub '-------------------------------------------------------------------------------------------'--------------------------------------------------------------------------------------------

Mail_Modul - 1

Sub mail() 'Destination -Eigenschaft 'Gibt das Ziel der Seriendruckergebnisse zurck oder legt es fest. 'Dabei kann es sich um eine der folgenden WdMailMergeDestination-Konstanten handeln: 'wdSendToEmail, 'wdSendToFax, 'wdSendToNewDocument oder 'wdSendToPrinter. 'Long Schreib-Lese-Zugriff.

'Beispiel zur MailAddressFieldName-Eigenschaft

'In diesem Beispiel wird das Dokument "Formbrief.doc" mit dem 'zugeordneten Datendokument verbunden. 'Die Ergebnisse werden an die E-Mail-Adressen im Seriendruckfeld "E-Mail" gesandt.

With Documents("c:\spamtest.doc").MailMerge .MailAsAttachment = False .MailAddressFieldName = "mail" .MailSubject = "75 Jahre Ingenieurausbildung in Wolfenbttel" .Destination = wdSendToEmail .Execute End With End Sub

NewMacros - 1

Sub rand_1_cm() ' ' rand_1_cm Makro ' Makro aufgezeichnet am 12.07.99 von IPTS03 ' With ActiveDocument.PageSetup .LineNumbering.Active = False .Orientation = wdOrientPortrait .TopMargin = CentimetersToPoints(1) .BottomMargin = CentimetersToPoints(1) .LeftMargin = CentimetersToPoints(1) .RightMargin = CentimetersToPoints(1) .Gutter = CentimetersToPoints(0) .HeaderDistance = CentimetersToPoints(1.25) .FooterDistance = CentimetersToPoints(1.25) .PageWidth = CentimetersToPoints(21) .PageHeight = CentimetersToPoints(29.7) .FirstPageTray = wdPrinterDefaultBin .OtherPagesTray = wdPrinterDefaultBin .SectionStart = wdSectionNewPage .OddAndEvenPagesHeaderFooter = False .DifferentFirstPageHeaderFooter = False .VerticalAlignment = wdAlignVerticalTop .SuppressEndnotes = False .MirrorMargins = False End With End Sub Sub courier_9() ' ' courier_9 Makro ' Makro aufgezeichnet am 12.07.99 von IPTS03 ' Selection.WholeStory Selection.Font.Size = 9 End Sub Sub layoutansicht() ' ' layoutansicht Makro ' Makro aufgezeichnet am 28.07.99 von IPTS03 ' If ActiveWindow.View.SplitSpecial = wdPaneNone Then ActiveWindow.ActivePane.View.Type = wdPageView Else ActiveWindow.View.Type = wdPageView End If End Sub Sub zweiseitenansicht() ' ' zweiseitenansicht Makro ' Makro aufgezeichnet am 28.07.99 von IPTS03 ' With ActiveWindow.ActivePane.View.Zoom .PageColumns = 2 .PageRows = 1 End With End Sub Sub saveas() ' ' saveas Makro ' Makro aufgezeichnet am 28.07.99 von IPTS03 ' Dim dateiname As String dateiname = ActiveDocument.FullName i = Len(dateiname) dateiname = Left$(dateiname, i - 4) + ".doc" ActiveDocument.saveas FileName:=dateiname, FileFormat:= _ wdFormatDocument, LockComments:=False, Password:="", AddToRecentFiles:= _ True, WritePassword:="", ReadOnlyRecommended:=False, EmbedTrueTypeFonts:= _ False, SaveNativePictureFormat:=False, SaveFormsData:=False, _ SaveAsAOCELetter:=False MsgBox "Datei: " + dateiname + " gespeichert!" End Sub Sub seite() ' ' seite Makro

NewMacros - 2 ' Makro aufgezeichnet am 04.08.99 von IPTS03 ' 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 NormalTemplate.AutoTextEntries("Name und Last Gedruckt").Insert Where:= _ Selection.Range If Selection.HeaderFooter.IsHeader = True Then ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageFooter Else ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader End If NormalTemplate.AutoTextEntries("Seite X von Y").Insert Where:=Selection. _ Range ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument End Sub Sub allebasic() Call rand_1_cm Call courier_9 Call layoutansicht Call seite Call zweiseitenansicht Call saveas End Sub Sub openbasicfile() ' ' openbasicfile Makro ' Makro aufgezeichnet am 04.11.99 von IPTS03 ' InputBox "" ChangeFileOpenDirectory "u:\ETC\mde\" dateiname = "" Documents.Open FileName:=dateiname, ConfirmConversions:=False, _ ReadOnly:=False, AddToRecentFiles:=False, PasswordDocument:="", _ PasswordTemplate:="", Revert:=False, WritePasswordDocument:="", _ WritePasswordTemplate:="", Format:=wdOpenFormatAuto End Sub Option Explicit

Sub minirand() ' ' minirand Makro ' Makro aufgezeichnet am 10.02.99 von turk ' With ActiveDocument.PageSetup .LineNumbering.Active = False .Orientation = wdOrientPortrait .TopMargin = CentimetersToPoints(1) .BottomMargin = CentimetersToPoints(1) .LeftMargin = CentimetersToPoints(1) .RightMargin = CentimetersToPoints(1) .Gutter = CentimetersToPoints(0) .HeaderDistance = CentimetersToPoints(0) .FooterDistance = CentimetersToPoints(0) .PageWidth = CentimetersToPoints(21) .PageHeight = CentimetersToPoints(29.7) .FirstPageTray = wdPrinterDefaultBin .OtherPagesTray = wdPrinterDefaultBin .SectionStart = wdSectionNewPage .OddAndEvenPagesHeaderFooter = False .DifferentFirstPageHeaderFooter = False .VerticalAlignment = wdAlignVerticalTop .SuppressEndnotes = False .MirrorMargins = False End With End Sub Sub courier9() ' ' courier9 Makro

NewMacros - 3 ' Makro aufgezeichnet am 16.02.99 von turk ' If ActiveWindow.View.SplitSpecial = wdPaneNone Then ActiveWindow.ActivePane.View.Type = wdPageView Else ActiveWindow.View.Type = wdPageView End If ActiveWindow.ActivePane.View.Zoom.PageFit = wdPageFitBestFit Selection.WholeStory Selection.Font.Size = 9 Selection.Font.name = "Courier New" Call minirand End Sub Sub c_new() ' ' c_new Makro ' Makro aufgezeichnet am 05.03.99 von turk ' Selection.WholeStory Selection.Font.name = "Courier New" Selection.Font.Size = 9 End Sub Sub Druck_aktuell() ' ' Druck_aktuell Makro ' Makro aufgezeichnet am 18.03.99 von turk ' Application.PrintOut FileName:="", Range:=wdPrintCurrentPage, Item:= _ wdPrintDocumentContent, Copies:=1, Pages:="", PageType:=wdPrintAllPages, _ Collate:=False, Background:=False, PrintToFile:=False End Sub Sub aktuelle_seite_drucken() ' ' aktuelle_seite_drucken Makro ' Makro aufgezeichnet am 08.03.00 von IPTS03 ' s = InputBox("Anzahl der Kopien eingeben", "Kopienanzahl aktuelle Seite drucken", 2) If s > 0 Then x = Int(s) Application.PrintOut FileName:="", Range:=wdPrintCurrentPage, Item:= _ wdPrintDocumentContent, Copies:=x, Pages:="", PageType:=wdPrintAllPages, _ Collate:=False, Background:=False, PrintToFile:=False, PrintZoomColumn:=0 _ , PrintZoomRow:=0, PrintZoomPaperWidth:=0, PrintZoomPaperHeight:=0 End If End Sub Sub bereich_drucken01() ' ' bereich_drucken01 Makro ' Makro aufgezeichnet am 20.04.00 von IPTS03 ' Application.PrintOut FileName:="", Range:=wdPrintRangeOfPages, Item:= _ wdPrintDocumentContent, Copies:=1, Pages:="51-60", PageType:= _ wdPrintAllPages, Collate:=False, Background:=False, PrintToFile:=False, _ PrintZoomColumn:=0, PrintZoomRow:=0, PrintZoomPaperWidth:=0, _ PrintZoomPaperHeight:=0 End Sub Sub bereich_drucken_alles() Application.PrintOut FileName:="", Range:=wdPrintRangeOfPages, Item:= _ wdPrintDocumentContent, Copies:=1, Pages:="1-10", PageType:= _ wdPrintAllPages, Collate:=False, Background:=False, PrintToFile:=False, _ PrintZoomColumn:=0, PrintZoomRow:=0, PrintZoomPaperWidth:=0, _ PrintZoomPaperHeight:=0 Application.PrintOut FileName:="", Range:=wdPrintRangeOfPages, Item:= _ wdPrintDocumentContent, Copies:=1, Pages:="11-20", PageType:= _ wdPrintAllPages, Collate:=False, Background:=False, PrintToFile:=False, _ PrintZoomColumn:=0, PrintZoomRow:=0, PrintZoomPaperWidth:=0, _ PrintZoomPaperHeight:=0 Application.PrintOut FileName:="", Range:=wdPrintRangeOfPages, Item:= _ wdPrintDocumentContent, Copies:=1, Pages:="21-30", PageType:= _ wdPrintAllPages, Collate:=False, Background:=False, PrintToFile:=False, _ PrintZoomColumn:=0, PrintZoomRow:=0, PrintZoomPaperWidth:=0, _ PrintZoomPaperHeight:=0 Application.PrintOut FileName:="", Range:=wdPrintRangeOfPages, Item:= _ wdPrintDocumentContent, Copies:=1, Pages:="31-40", PageType:= _ wdPrintAllPages, Collate:=False, Background:=False, PrintToFile:=False, _

NewMacros - 4 PrintZoomColumn:=0, PrintZoomRow:=0, PrintZoomPaperWidth:=0, _ PrintZoomPaperHeight:=0 Application.PrintOut FileName:="", Range:=wdPrintRangeOfPages, Item:= _ wdPrintDocumentContent, Copies:=1, Pages:="41-50", PageType:= _ wdPrintAllPages, Collate:=False, Background:=False, PrintToFile:=False, PrintZoomColumn:=0, PrintZoomRow:=0, PrintZoomPaperWidth:=0, _ PrintZoomPaperHeight:=0 Application.PrintOut FileName:="", Range:=wdPrintRangeOfPages, Item:= _ wdPrintDocumentContent, Copies:=1, Pages:="51-60", PageType:= _ wdPrintAllPages, Collate:=False, Background:=False, PrintToFile:=False, PrintZoomColumn:=0, PrintZoomRow:=0, PrintZoomPaperWidth:=0, _ PrintZoomPaperHeight:=0 Application.PrintOut FileName:="", Range:=wdPrintRangeOfPages, Item:= _ wdPrintDocumentContent, Copies:=1, Pages:="61-70", PageType:= _ wdPrintAllPages, Collate:=False, Background:=False, PrintToFile:=False, PrintZoomColumn:=0, PrintZoomRow:=0, PrintZoomPaperWidth:=0, _ PrintZoomPaperHeight:=0 Application.PrintOut FileName:="", Range:=wdPrintRangeOfPages, Item:= _ wdPrintDocumentContent, Copies:=1, Pages:="71-80", PageType:= _ wdPrintAllPages, Collate:=False, Background:=False, PrintToFile:=False, PrintZoomColumn:=0, PrintZoomRow:=0, PrintZoomPaperWidth:=0, _ PrintZoomPaperHeight:=0 Application.PrintOut FileName:="", Range:=wdPrintRangeOfPages, Item:= _ wdPrintDocumentContent, Copies:=1, Pages:="81-90", PageType:= _ wdPrintAllPages, Collate:=False, Background:=False, PrintToFile:=False, PrintZoomColumn:=0, PrintZoomRow:=0, PrintZoomPaperWidth:=0, _ PrintZoomPaperHeight:=0 Application.PrintOut FileName:="", Range:=wdPrintRangeOfPages, Item:= _ wdPrintDocumentContent, Copies:=1, Pages:="91-100", PageType:= _ wdPrintAllPages, Collate:=False, Background:=False, PrintToFile:=False, PrintZoomColumn:=0, PrintZoomRow:=0, PrintZoomPaperWidth:=0, _ PrintZoomPaperHeight:=0 Application.PrintOut FileName:="", Range:=wdPrintRangeOfPages, Item:= _ wdPrintDocumentContent, Copies:=1, Pages:="101-110", PageType:= _ wdPrintAllPages, Collate:=False, Background:=False, PrintToFile:=False, PrintZoomColumn:=0, PrintZoomRow:=0, PrintZoomPaperWidth:=0, _ PrintZoomPaperHeight:=0 Application.PrintOut FileName:="", Range:=wdPrintRangeOfPages, Item:= _ wdPrintDocumentContent, Copies:=1, Pages:="111-120", PageType:= _ wdPrintAllPages, Collate:=False, Background:=False, PrintToFile:=False, PrintZoomColumn:=0, PrintZoomRow:=0, PrintZoomPaperWidth:=0, _ PrintZoomPaperHeight:=0 Application.PrintOut FileName:="", Range:=wdPrintRangeOfPages, Item:= _ wdPrintDocumentContent, Copies:=1, Pages:="121-130", PageType:= _ wdPrintAllPages, Collate:=False, Background:=False, PrintToFile:=False, PrintZoomColumn:=0, PrintZoomRow:=0, PrintZoomPaperWidth:=0, _ PrintZoomPaperHeight:=0 End Sub Sub seitenwechsel() ' ' seitenwechsel Makro ' Makro aufgezeichnet am 09.05.00 von IPTS03 ' Selection.GoTo What:=wdGoToPage, Which:=wdGoToNext, Count:=1, name:="" Selection.Find.ClearFormatting With Selection.Find .Text = "" .Replacement.Text = "" .Forward = True .Wrap = wdFindContinue .Format = False .MatchCase = False .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With End Sub Sub serie() ' ' serie Makro ' Makro aufgezeichnet am 26.05.00 von IPTS03 ' With ActiveDocument.MailMerge .Destination = wdSendToNewDocument

NewMacros - 5 .Execute End With Windows(2).Activate End Sub Sub Makro2() ' ' Makro2 Makro ' Makro aufgezeichnet am 29.05.00 von IPTS03 ' ActiveDocument.Sections(1).ProtectedForForms = True ActiveDocument.Sections(2).ProtectedForForms = False ActiveDocument.Protect Password:="test", NoReset:=False, Type:= _ wdAllowOnlyFormFields End Sub Sub datei_wahl() ' ' Makro3 Makro ' Makro aufgezeichnet am 29.05.00 von IPTS03 ' With Active.Document .Protect = True .Password = "Test" End With End Sub Sub adressbook() ' ' adressbook Makro ' Makro aufgezeichnet am 30.05.00 von IPTS03 ' WordBasic.InsertAddress End Sub Sub leerersetzen() ' ' leerersetzen Makro ' Makro aufgezeichnet am 18.09.00 von IPTS03 ' For i = 100 To 3 Step -1 x = Left$(" y = Left$(x, i - 1) Selection.Find.ClearFormatting Selection.Find.Replacement.ClearFormatting With Selection.Find .Text = x .Replacement.Text = y .Forward = True .Wrap = wdFindContinue .Format = False .MatchCase = False .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With Selection.Find.Execute Replace:=wdReplaceAll Next i End Sub Sub zweileerzutab() Selection.Find.ClearFormatting Selection.Find.Replacement.ClearFormatting With Selection.Find .Text = " " .Replacement.Text = "^t" .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

", i)

NewMacros - 6 Sub druck_eins(name) Documents.Open FileName:=name, ConfirmConversions:=False, _ ReadOnly:=False, AddToRecentFiles:=False, PasswordDocument:="", _ PasswordTemplate:="", Revert:=False, WritePasswordDocument:="", _ WritePasswordTemplate:="", Format:=wdOpenFormatAuto Application.PrintOut FileName:="", Range:=wdPrintAllDocument, Item:= _ wdPrintDocumentContent, Copies:=1, Pages:="", PageType:=wdPrintAllPages, _ Collate:=True, Background:=False, PrintToFile:=False, PrintZoomColumn:=0, _ PrintZoomRow:=0, PrintZoomPaperWidth:=0, PrintZoomPaperHeight:=0 ActiveDocument.Close End Sub Sub druck_alle_aus_einem_verzeichnis() Dim fs, f, f1, fc, s, t t = "U:\Buse" Set fs = CreateObject("Scripting.FileSystemObject") Set f = fs.GetFolder(t) Set fc = f.Files For Each f1 In fc s = t & "\" & f1.name Call druck_eins(s) Next End Sub Sub druckerfestlegen() x = ActivePrinter szDefault = GetDefaultPrinter() For Each Printer In Printers szName = Printer.DeviceName cbPrinters.AddItem szName If (0 = StrComp(szName, szDefault, vbTextCompare)) Then cbPrinters.ListIndex = cbPrinters.NewIndex End If Next End Sub Sub grafik_rein() ' ' grafik_rein Makro ' Makro aufgezeichnet am 13.11.03 von IPT ' Selection.InlineShapes.AddPicture FileName:= _ "C:\Eigene Dateien\Meine Bilder\Freitag, September 19, 2003\~hpa0000.jpg" _ , LinkToFile:=False, SaveWithDocument:=True Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend Selection.InlineShapes(1).Fill.Visible = msoFalse Selection.InlineShapes(1).Fill.Transparency = 0# Selection.InlineShapes(1).Line.Weight = 0.75 Selection.InlineShapes(1).Line.Transparency = 0# Selection.InlineShapes(1).Line.Visible = msoFalse Selection.InlineShapes(1).LockAspectRatio = msoTrue Selection.InlineShapes(1).Height = 283.45 Selection.InlineShapes(1).Width = 387.2 Selection.InlineShapes(1).PictureFormat.Brightness = 0.5 Selection.InlineShapes(1).PictureFormat.Contrast = 0.5 Selection.InlineShapes(1).PictureFormat.ColorType = msoPictureAutomatic Selection.InlineShapes(1).PictureFormat.CropLeft = 0# Selection.InlineShapes(1).PictureFormat.CropRight = 0# Selection.InlineShapes(1).PictureFormat.CropTop = 0# Selection.InlineShapes(1).PictureFormat.CropBottom = 0# Selection.MoveRight Unit:=wdCharacter, Count:=1 Selection.MoveDown Unit:=wdLine, Count:=1, Extend:=wdExtend Selection.Delete Unit:=wdCharacter, Count:=1 Selection.MoveDown Unit:=wdLine, Count:=2 Selection.InsertBreak Type:=wdSectionBreakNextPage End Sub Sub gtgtgt() filetoopen = Application.GetOpenFilename("Grafiken (*.jpg), *.jpg") Selection.InlineShapes.AddPicture FileName:= _ "C:\Eigene Dateien\Meine Bilder\Freitag, September 19, 2003\~hpa0000.jpg" _ , LinkToFile:=False, SaveWithDocument:=True Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend Selection.InlineShapes(1).ConvertToShape Selection.ShapeRange.Fill.Visible = msoFalse Selection.ShapeRange.Fill.Transparency = 0# Selection.ShapeRange.Line.Weight = 0.75

NewMacros - 7 Selection.ShapeRange.Line.DashStyle = msoLineSolid Selection.ShapeRange.Line.Style = msoLineSingle Selection.ShapeRange.Line.Transparency = 0# Selection.ShapeRange.Line.Visible = msoFalse Selection.ShapeRange.LockAspectRatio = msoTrue Selection.ShapeRange.Height = 283.45 Selection.ShapeRange.Width = 387.5 Selection.ShapeRange.PictureFormat.Brightness = 0.5 Selection.ShapeRange.PictureFormat.Contrast = 0.5 Selection.ShapeRange.PictureFormat.ColorType = msoPictureAutomatic Selection.ShapeRange.PictureFormat.CropLeft = 0# Selection.ShapeRange.PictureFormat.CropRight = 0# Selection.ShapeRange.PictureFormat.CropTop = 0# Selection.ShapeRange.PictureFormat.CropBottom = 0# Selection.ShapeRange.RelativeHorizontalPosition = _ wdRelativeHorizontalPositionPage Selection.ShapeRange.RelativeVerticalPosition = _ wdRelativeVerticalPositionPage Selection.ShapeRange.Left = CentimetersToPoints(5) Selection.ShapeRange.Top = CentimetersToPoints(4) Selection.ShapeRange.LockAnchor = False Selection.ShapeRange.WrapFormat.AllowOverlap = True Selection.ShapeRange.WrapFormat.Side = wdWrapBoth Selection.ShapeRange.WrapFormat.DistanceTop = CentimetersToPoints(0) Selection.ShapeRange.WrapFormat.DistanceBottom = CentimetersToPoints(0) Selection.ShapeRange.WrapFormat.DistanceLeft = CentimetersToPoints(0.32) Selection.ShapeRange.WrapFormat.DistanceRight = CentimetersToPoints(0.32) Selection.ShapeRange.WrapFormat.Type = 3 Selection.ShapeRange.ZOrder 5 End Sub

Sub filesauf() Private Const Verzeichnis = "C:\Eigene Dateien" Private Const Filter = "*.doc" Sub DateiAuswaehlen() savEnv = Options.DefaultFilePath(wdCurrentFolderPath) On Error Resume Next Application.ChangeFileOpenDirectory Verzeichnis Fehler = Err.Number On Error GoTo 0 If Not Fehler = 0 And Not Fehler = 4172 Then MsgBox Err.Description, vbCritical, "Datei auswhlen" Exit Sub End If With Dialogs(wdDialogFileOpen) .name = Filter On Error Resume Next Dim Antwort As Boolean Antwort = .Display While Err.Number = 5174 MsgBox "Sie knnen ausschliesslich eine einzige Datei auswhlen.", _ vbExclamation, "Datei auswhlen" Err.Clear Antwort = .Display Wend Select Case Antwort Case -1 Datei = CurDir & "\" & .name MsgBox Datei, vbInformation, "Datei auswhlen." Case 0 MsgBox "Knacks." End Select End With On Error Resume Next Application.ChangeFileOpenDirectory savEnv 'restore folder on entry End Sub End Sub Sub Makro1() ' ' Makro1 Makro

NewMacros - 8 ' Makro aufgezeichnet am 15.12.03 von IPT ' Selection.InsertBreak Type:=wdSectionBreakNextPage 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.HeaderFooter.LinkToPrevious = Not Selection.HeaderFooter. _ LinkToPrevious If Selection.HeaderFooter.IsHeader = True Then ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageFooter Else ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader End If Selection.HeaderFooter.LinkToPrevious = Not Selection.HeaderFooter. _ LinkToPrevious ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument End Sub Sub druck_pdf() Application.PrintOut FileName:="", Range:=wdPrintCurrentPage, Item:= _ wdPrintDocumentContent, Copies:=1, Pages:="", PageType:=wdPrintAllPages, _ ManualDuplexPrint:=False, Collate:=False, Background:=False, PrintToFile _ :=False, PrintZoomColumn:=0, PrintZoomRow:=0, PrintZoomPaperWidth:=0, _ PrintZoomPaperHeight:=0 Application.Browser.Next End Sub Sub pdf_alles() For i = 4 To 28 Call druck_pdf Next i End Sub Sub rahmen_groesser() Selection.ShapeRange.Height = 48.2 Selection.ShapeRange.TextFrame.MarginBottom = 0# ' Selection.ShapeRange.Regroup.Select End Sub Sub Makro3() ' ' Makro3 Makro ' Makro aufgezeichnet am 07.07.2005 von ipt ' Selection.Copy Selection.Find.ClearFormatting Selection.Find.Replacement.ClearFormatting With Selection.Find .Text = "^p" .Replacement.Text = "^p' " .Forward = True .Wrap = wdFindAsk .Format = False .MatchCase = False .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With Selection.Find.Execute With Selection If .Find.Forward = True Then .Collapse Direction:=wdCollapseStart Else .Collapse Direction:=wdCollapseEnd End If .Find.Execute Replace:=wdReplaceOne If .Find.Forward = True Then .Collapse Direction:=wdCollapseEnd Else .Collapse Direction:=wdCollapseStart End If .Find.Execute End With

NewMacros - 9 End Sub Sub hdht() ' ' Makro4 Makro ' Makro aufgezeichnet am 20.10.2005 von IPT ' Selection.WholeStory Selection.Style = ActiveDocument.Styles("Aufgaben-hdht") Selection.Find.ClearFormatting Selection.Find.Replacement.ClearFormatting With Selection.Find .Text = "^p^p^p" .Replacement.Text = "^p" .Forward = True .Wrap = wdFindAsk .Format = False .MatchCase = False .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With Selection.Find.Execute Replace:=wdReplaceAll Selection.Find.Execute Replace:=wdReplaceAll Selection.Find.Execute Replace:=wdReplaceAll ActiveWindow.ActivePane.View.Zoom.PageFit = wdPageFitFullPage End Sub Sub Makro4() ' ' Makro4 Makro ' Makro aufgezeichnet am 20.02.2006 von IPT ' Windows("50jahre-heft-aktuell-rep.doc").Activate Windows("fontcheck.doc").Activate End Sub Sub druckerliste() ' ' druckerliste Makro ' Makro aufgezeichnet am 10.03.2006 von IPT ' Application.WindowState = wdWindowStateMaximize ActivePrinter = "HP OfficeJet G Series Fax" ActivePrinter = "HP OfficeJet G Series" ActivePrinter = "Adobe PDF" ActivePrinter = "\\rzds003\Kyocera_FS-1750_(KPDL-2)_ipt_r116" Application.PrintOut FileName:="", Range:=wdPrintAllDocument, Item:= _ wdPrintDocumentContent, Copies:=1, Pages:="", PageType:=wdPrintAllPages, _ ManualDuplexPrint:=False, Collate:=False, Background:=False, PrintToFile _ :=False, PrintZoomColumn:=0, PrintZoomRow:=0, PrintZoomPaperWidth:=0, _ PrintZoomPaperHeight:=0 End Sub Sub Makro5() ' ' Makro5 Makro ' Makro aufgezeichnet am 10.03.2006 von IPT ' ActivePrinter = "\\rzds003\HP DesignJet 750C+ (E/A0) by HP_ipt_R115-Diplomarbeitsraum" End Sub Sub Makro6() ' ' Makro6 Makro ' Makro aufgezeichnet am 04.04.2006 von IPT ' Selection.InlineShapes(1).Fill.Visible = msoFalse Selection.InlineShapes(1).Fill.Solid Selection.InlineShapes(1).Fill.Transparency = 0# Selection.InlineShapes(1).Line.Weight = 0.75 Selection.InlineShapes(1).Line.Transparency = 0# Selection.InlineShapes(1).Line.Visible = msoFalse Selection.InlineShapes(1).LockAspectRatio = msoTrue Selection.InlineShapes(1).Height = 566.95 Selection.InlineShapes(1).Width = 395.7 Selection.InlineShapes(1).PictureFormat.Brightness = 0.5 Selection.InlineShapes(1).PictureFormat.Contrast = 0.5 Selection.InlineShapes(1).PictureFormat.ColorType = msoPictureAutomatic

NewMacros - 10 Selection.InlineShapes(1).PictureFormat.CropLeft = 0# Selection.InlineShapes(1).PictureFormat.CropRight = 0# Selection.InlineShapes(1).PictureFormat.CropTop = 0# Selection.InlineShapes(1).PictureFormat.CropBottom = 0# End Sub Sub Makro7() ' ' Makro7 Makro ' Makro aufgezeichnet am 09.06.2006 von IPT ' Selection.MoveDown Unit:=wdLine, Count:=1, Extend:=wdExtend Selection.MoveRight Unit:=wdCharacter, Count:=14, Extend:=wdExtend Selection.MoveDown Unit:=wdLine, Count:=2, Extend:=wdExtend Selection.MoveRight Unit:=wdCharacter, Count:=1, Extend:=wdExtend Selection.MoveDown Unit:=wdLine, Count:=322, Extend:=wdExtend Selection.Copy Selection.HomeKey Unit:=wdStory End Sub Sub drucken_lfd_seiten_von_bis() ' erstmal an den Anfang des dokumentse gehen wert = InputBox("Bitte erste zu druckende Seite eingeben :", "Erste seite", 1) wert = Trim(wert) erste_seite = Val(wert) If erste_seite > 0 Then Else MsgBox "Falsche Eingabe, keine gltige Zahl" Exit Sub End If wert = InputBox("Bitte letzte zu druckende Seite eingeben :", "Letzte seite", 1) wert = Trim(wert) letzte_seite = Val(wert) If letzte_seite > 0 Then Else MsgBox "Falsche Eingabe, keine gltige Zahl" Exit Sub End If vorlauf = erste_seite - 1 ' zu druckende seitenzahlen feststellen anz_seiten = letzte_seite - erste_seite Selection.HomeKey Unit:=wdStory ' nun zunchst auf die 1. zu druckende seite gehen For seitex = 1 To vorlauf Selection.GoTo What:=wdGoToPage, Which:=wdGoToNext, Count:=1, name:="" Next seitex For seitex = erste_seite To letzte_seite ' aktuelle seite drucken Application.PrintOut FileName:="", Range:=wdPrintCurrentPage, Item:= _ wdPrintDocumentContent, Copies:=1, Pages:="", PageType:=wdPrintAllPages, _ Collate:=False, Background:=False, PrintToFile:=False ' auf die nchste Seite gehen Selection.GoTo What:=wdGoToPage, Which:=wdGoToNext, Count:=1, name:="" Next seitex End Sub Sub drtest() 'wdActiveEndAdjustedPageNumber 'wdActiveEndPageNumber 'wdActiveEndSectionNumber = ak_seite_im_abschnitt = ak_seite = ak_abschnitt = ak_max_seiten zzzz = 1 ' abschnitt fragen abschnitt = InputBox("Bitte Nr. des Abschnittes angeben :", "Abschnittseingabe", 1) abschnitt = Trim(abschnitt) absnr = Val(abschnitt) absnr = y If absnr > 0 Then druckbereich = "p1s" & abschnitt & "-p2s" & abschnitt Application.PrintOut FileName:="", Range:=wdPrintRangeOfPages, Item:= _ wdPrintDocumentContent, Copies:=1, Pages:=druckbereich, PageType:= _ w x y z

NewMacros - 11 wdPrintAllPages, ManualDuplexPrint:=False, Collate:=False, Background:= _ False, PrintToFile:=False, PrintZoomColumn:=0, PrintZoomRow:=0, _ PrintZoomPaperWidth:=0, PrintZoomPaperHeight:=0 Else MsgBox "Falsche Eingabe" End If End Sub Sub sw() ' ' sw Makro ' Makro aufgezeichnet am 04.05.2007 von IPT ' Selection.GoTo What:=wdGoToPage, Which:=wdGoToNext, Count:=1, name:="" Selection.Find.ClearFormatting With Selection.Find .Text = "" .Replacement.Text = "" .Forward = True .Wrap = wdFindContinue .Format = False .MatchCase = False .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With End Sub

NewMacros1 - 1

Sub rand_1_cm() ' ' rand_1_cm Makro ' Makro aufgezeichnet am 12.07.99 von IPTS03 ' With ActiveDocument.PageSetup .LineNumbering.Active = False .Orientation = wdOrientPortrait .TopMargin = CentimetersToPoints(1) .BottomMargin = CentimetersToPoints(1) .LeftMargin = CentimetersToPoints(1) .RightMargin = CentimetersToPoints(1) .Gutter = CentimetersToPoints(0) .HeaderDistance = CentimetersToPoints(1.25) .FooterDistance = CentimetersToPoints(1.25) .PageWidth = CentimetersToPoints(21) .PageHeight = CentimetersToPoints(29.7) .FirstPageTray = wdPrinterDefaultBin .OtherPagesTray = wdPrinterDefaultBin .SectionStart = wdSectionNewPage .OddAndEvenPagesHeaderFooter = False .DifferentFirstPageHeaderFooter = False .VerticalAlignment = wdAlignVerticalTop .SuppressEndnotes = False .MirrorMargins = False End With End Sub Sub courier_9() ' ' courier_9 Makro ' Makro aufgezeichnet am 12.07.99 von IPTS03 ' Selection.WholeStory Selection.Font.Size = 9 End Sub Sub layoutansicht() ' ' layoutansicht Makro ' Makro aufgezeichnet am 28.07.99 von IPTS03 ' If ActiveWindow.View.SplitSpecial = wdPaneNone Then ActiveWindow.ActivePane.View.Type = wdPageView Else ActiveWindow.View.Type = wdPageView End If End Sub Sub zweiseitenansicht() ' ' zweiseitenansicht Makro ' Makro aufgezeichnet am 28.07.99 von IPTS03 ' With ActiveWindow.ActivePane.View.Zoom .PageColumns = 2 .PageRows = 1 End With End Sub Sub saveas() ' ' saveas Makro ' Makro aufgezeichnet am 28.07.99 von IPTS03 ' Dim dateiname As String dateiname = ActiveDocument.FullName i = Len(dateiname) dateiname = Left$(dateiname, i - 4) + ".doc" ActiveDocument.saveas FileName:=dateiname, FileFormat:= _ wdFormatDocument, LockComments:=False, Password:="", AddToRecentFiles:= _ True, WritePassword:="", ReadOnlyRecommended:=False, EmbedTrueTypeFonts:= _ False, SaveNativePictureFormat:=False, SaveFormsData:=False, _ SaveAsAOCELetter:=False MsgBox "Datei: " + dateiname + " gespeichert!" End Sub Sub seite() '

NewMacros1 - 2

' seite Makro ' Makro aufgezeichnet am 04.08.99 von IPTS03 ' 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 NormalTemplate.AutoTextEntries("Name und Last Gedruckt").Insert Where:= _ Selection.Range If Selection.HeaderFooter.IsHeader = True Then ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageFooter Else ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader End If NormalTemplate.AutoTextEntries("Seite X von Y").Insert Where:=Selection. _ Range ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument End Sub Sub allebasic() Call rand_1_cm Call courier_9 Call layoutansicht Call seite Call zweiseitenansicht Call saveas End Sub Sub openbasicfile() ' ' openbasicfile Makro ' Makro aufgezeichnet am 04.11.99 von IPTS03 ' InputBox "" ChangeFileOpenDirectory "u:\ETC\mde\" dateiname = "" Documents.Open FileName:=dateiname, ConfirmConversions:=False, _ ReadOnly:=False, AddToRecentFiles:=False, PasswordDocument:="", _ PasswordTemplate:="", Revert:=False, WritePasswordDocument:="", _ WritePasswordTemplate:="", Format:=wdOpenFormatAuto End Sub Option Explicit Sub d1() ActivePrinter = "HP OfficeJet G Series Fax" 'ActivePrinter = "HP OfficeJet G Series Fax auf OfficeJetG85_DZ116" End Sub Sub d2() ActivePrinter = "Kyocera FS-1750 (KPDL-2) R.116" 'ActivePrinter = "Kyocera FS-1750 (KPDL-2) R.116 auf \\Fbmns1\03-FS1750-R116-DWS" End Sub Sub d3() ActivePrinter = "Fiery XJK1000 1560-65 v2015.802" 'ActivePrinter = "Fiery XJK1000 1560-65 v2015.802 auf \\rzds001\rzps4" End Sub Sub d4() Application.ActivePrinter = "HP DesignJet 2500CP" 'Application.ActivePrinter = "HP DesignJet 2500CP auf \\rzds001\rzps3" End Sub Sub d5() ActivePrinter = "Kyocera FS-1750 (KPDL-2) R.115" 'ActivePrinter = "Kyocera FS-1750 (KPDL-2) R.115 auf \\Fbmns1\03-FS1750-R115-DWS" End Sub Sub d6() 'ActivePrinter = "HP DeskJet 500C Printer" MsgBox "Drucker: " & ActivePrinter End Sub

Sub drucker() ' Ein Eingabedialog soll fragen, welcher Drucker Standarddrucker sein soll Dim s1 As String Dim s2 As String Dim s3 As String

NewMacros1 - 3 Dim s4 As String Dim s5 As String Dim s6 As String Dim x As Integer Dim xpos As Integer Dim ypos As Integer Dim Titel As String Dim prompt As String Dim default As Integer ' constants xpos = 5000 ypos = 3000 'HP OfficeJet G Series Fax auf OfficeJetG85_DZ116 'Kyocera FS-1750 (KPDL-2) R.116 auf \\Fbmns1\03-FS1750-R116-DWS 'Fiery XJK1000 1560-65 v2015.802 auf \\rzds001\rzps4 'HP DesignJet 2500CP auf LPT1: 'HP DesignJet 2500CP auf \\rzds001\rzps3 'Kyocera FS-1750 (KPDL-2) R.115 auf \\Fbmns1\03-FS1750-R115-DWS 'Acrobat PDFWriter auf LPT1: Titel = "Auswahl des Standarddruckers" s1 = "1 = HP OfficeJet G Series Fax DZ116" s2 = "2 = Kyocera FS-1750 (KPDL-2) DZ116" s3 = "3 = Fiery XJK1000 1560-65 v2015.802" s4 = "4 = HP DesignJet 2500CP3" s5 = "5 = Kyocera FS-1750 (KPDL-2) R.115" s6 = "6 = Keine nderung" prompt = s1 & vbCrLf & s2 & vbCrLf & s3 & vbCrLf & s4 & vbCrLf & s5 & vbCrLf & s6 default = 1 x = 0 While ((x <> 1) And (x <> 2) And (x <> 3) And (x <> 4) And (x <> 5) And (x <> 6)) x = InputBox(prompt, Titel, default, xpos, ypos) If x <> 1 And x <> 2 And x <> 3 And x <> 4 And x <> 5 And x <> 6 Then MsgBox "Fehleingabe !!" Wend If x = 1 Then Call d1 ElseIf x = 2 Then Call d2 ElseIf x = 3 Then Call d3 ElseIf x = 4 Then Call d4 ElseIf x = 5 Then Call d5 ElseIf x = 6 Then Call d6 End If End Sub Sub minirand() ' ' minirand Makro ' Makro aufgezeichnet am 10.02.99 von turk ' With ActiveDocument.PageSetup .LineNumbering.Active = False .Orientation = wdOrientPortrait .TopMargin = CentimetersToPoints(1) .BottomMargin = CentimetersToPoints(1) .LeftMargin = CentimetersToPoints(1) .RightMargin = CentimetersToPoints(1) .Gutter = CentimetersToPoints(0) .HeaderDistance = CentimetersToPoints(0) .FooterDistance = CentimetersToPoints(0) .PageWidth = CentimetersToPoints(21) .PageHeight = CentimetersToPoints(29.7) .FirstPageTray = wdPrinterDefaultBin .OtherPagesTray = wdPrinterDefaultBin .SectionStart = wdSectionNewPage .OddAndEvenPagesHeaderFooter = False .DifferentFirstPageHeaderFooter = False .VerticalAlignment = wdAlignVerticalTop .SuppressEndnotes = False .MirrorMargins = False End With

NewMacros1 - 4 End Sub Sub courier9() ' ' courier9 Makro ' Makro aufgezeichnet am 16.02.99 von turk ' If ActiveWindow.View.SplitSpecial = wdPaneNone Then ActiveWindow.ActivePane.View.Type = wdPageView Else ActiveWindow.View.Type = wdPageView End If ActiveWindow.ActivePane.View.Zoom.PageFit = wdPageFitBestFit Selection.WholeStory Selection.Font.Size = 9 Selection.Font.name = "Courier New" Call minirand End Sub Sub c_new() ' ' c_new Makro ' Makro aufgezeichnet am 05.03.99 von turk ' Selection.WholeStory Selection.Font.name = "Courier New" Selection.Font.Size = 9 End Sub Sub Druck_aktuell() ' ' Druck_aktuell Makro ' Makro aufgezeichnet am 18.03.99 von turk ' Application.PrintOut FileName:="", Range:=wdPrintCurrentPage, Item:= _ wdPrintDocumentContent, Copies:=1, Pages:="", PageType:=wdPrintAllPages, _ Collate:=False, Background:=False, PrintToFile:=False End Sub Sub aktuelle_seite_drucken() ' ' aktuelle_seite_drucken Makro ' Makro aufgezeichnet am 08.03.00 von IPTS03 ' s = InputBox("Anzahl der Kopien eingeben", "Kopienanzahl aktuelle Seite drucken", 2) x = Int(s) Application.PrintOut FileName:="", Range:=wdPrintCurrentPage, Item:= _ wdPrintDocumentContent, Copies:=x, Pages:="", PageType:=wdPrintAllPages, _ Collate:=False, Background:=False, PrintToFile:=False, PrintZoomColumn:=0 _ , PrintZoomRow:=0, PrintZoomPaperWidth:=0, PrintZoomPaperHeight:=0 End Sub Sub bereich_drucken01() ' ' bereich_drucken01 Makro ' Makro aufgezeichnet am 20.04.00 von IPTS03 ' Application.PrintOut FileName:="", Range:=wdPrintRangeOfPages, Item:= _ wdPrintDocumentContent, Copies:=1, Pages:="51-60", PageType:= _ wdPrintAllPages, Collate:=False, Background:=False, PrintToFile:=False, _ PrintZoomColumn:=0, PrintZoomRow:=0, PrintZoomPaperWidth:=0, _ PrintZoomPaperHeight:=0 End Sub Sub bereich_drucken_alles() Application.PrintOut FileName:="", Range:=wdPrintRangeOfPages, Item:= _ wdPrintDocumentContent, Copies:=1, Pages:="1-10", PageType:= _ wdPrintAllPages, Collate:=False, Background:=False, PrintToFile:=False, _ PrintZoomColumn:=0, PrintZoomRow:=0, PrintZoomPaperWidth:=0, _ PrintZoomPaperHeight:=0 Application.PrintOut FileName:="", Range:=wdPrintRangeOfPages, Item:= _ wdPrintDocumentContent, Copies:=1, Pages:="11-20", PageType:= _ wdPrintAllPages, Collate:=False, Background:=False, PrintToFile:=False, _ PrintZoomColumn:=0, PrintZoomRow:=0, PrintZoomPaperWidth:=0, _ PrintZoomPaperHeight:=0 Application.PrintOut FileName:="", Range:=wdPrintRangeOfPages, Item:= _ wdPrintDocumentContent, Copies:=1, Pages:="21-30", PageType:= _ wdPrintAllPages, Collate:=False, Background:=False, PrintToFile:=False, _ PrintZoomColumn:=0, PrintZoomRow:=0, PrintZoomPaperWidth:=0, _ PrintZoomPaperHeight:=0 Application.PrintOut FileName:="", Range:=wdPrintRangeOfPages, Item:= _

NewMacros1 - 5 wdPrintDocumentContent, Copies:=1, Pages:="31-40", PageType:= _ wdPrintAllPages, Collate:=False, Background:=False, PrintToFile:=False, PrintZoomColumn:=0, PrintZoomRow:=0, PrintZoomPaperWidth:=0, _ PrintZoomPaperHeight:=0 Application.PrintOut FileName:="", Range:=wdPrintRangeOfPages, Item:= _ wdPrintDocumentContent, Copies:=1, Pages:="41-50", PageType:= _ wdPrintAllPages, Collate:=False, Background:=False, PrintToFile:=False, PrintZoomColumn:=0, PrintZoomRow:=0, PrintZoomPaperWidth:=0, _ PrintZoomPaperHeight:=0 Application.PrintOut FileName:="", Range:=wdPrintRangeOfPages, Item:= _ wdPrintDocumentContent, Copies:=1, Pages:="51-60", PageType:= _ wdPrintAllPages, Collate:=False, Background:=False, PrintToFile:=False, PrintZoomColumn:=0, PrintZoomRow:=0, PrintZoomPaperWidth:=0, _ PrintZoomPaperHeight:=0 Application.PrintOut FileName:="", Range:=wdPrintRangeOfPages, Item:= _ wdPrintDocumentContent, Copies:=1, Pages:="61-70", PageType:= _ wdPrintAllPages, Collate:=False, Background:=False, PrintToFile:=False, PrintZoomColumn:=0, PrintZoomRow:=0, PrintZoomPaperWidth:=0, _ PrintZoomPaperHeight:=0 Application.PrintOut FileName:="", Range:=wdPrintRangeOfPages, Item:= _ wdPrintDocumentContent, Copies:=1, Pages:="71-80", PageType:= _ wdPrintAllPages, Collate:=False, Background:=False, PrintToFile:=False, PrintZoomColumn:=0, PrintZoomRow:=0, PrintZoomPaperWidth:=0, _ PrintZoomPaperHeight:=0 Application.PrintOut FileName:="", Range:=wdPrintRangeOfPages, Item:= _ wdPrintDocumentContent, Copies:=1, Pages:="81-90", PageType:= _ wdPrintAllPages, Collate:=False, Background:=False, PrintToFile:=False, PrintZoomColumn:=0, PrintZoomRow:=0, PrintZoomPaperWidth:=0, _ PrintZoomPaperHeight:=0 Application.PrintOut FileName:="", Range:=wdPrintRangeOfPages, Item:= _ wdPrintDocumentContent, Copies:=1, Pages:="91-100", PageType:= _ wdPrintAllPages, Collate:=False, Background:=False, PrintToFile:=False, PrintZoomColumn:=0, PrintZoomRow:=0, PrintZoomPaperWidth:=0, _ PrintZoomPaperHeight:=0 Application.PrintOut FileName:="", Range:=wdPrintRangeOfPages, Item:= _ wdPrintDocumentContent, Copies:=1, Pages:="101-110", PageType:= _ wdPrintAllPages, Collate:=False, Background:=False, PrintToFile:=False, PrintZoomColumn:=0, PrintZoomRow:=0, PrintZoomPaperWidth:=0, _ PrintZoomPaperHeight:=0 Application.PrintOut FileName:="", Range:=wdPrintRangeOfPages, Item:= _ wdPrintDocumentContent, Copies:=1, Pages:="111-120", PageType:= _ wdPrintAllPages, Collate:=False, Background:=False, PrintToFile:=False, PrintZoomColumn:=0, PrintZoomRow:=0, PrintZoomPaperWidth:=0, _ PrintZoomPaperHeight:=0 Application.PrintOut FileName:="", Range:=wdPrintRangeOfPages, Item:= _ wdPrintDocumentContent, Copies:=1, Pages:="121-130", PageType:= _ wdPrintAllPages, Collate:=False, Background:=False, PrintToFile:=False, PrintZoomColumn:=0, PrintZoomRow:=0, PrintZoomPaperWidth:=0, _ PrintZoomPaperHeight:=0 End Sub Sub seitenwechsel() ' ' seitenwechsel Makro ' Makro aufgezeichnet am 09.05.00 von IPTS03 ' Selection.GoTo What:=wdGoToPage, Which:=wdGoToNext, Count:=1, name:="" Selection.Find.ClearFormatting With Selection.Find .Text = "" .Replacement.Text = "" .Forward = True .Wrap = wdFindContinue .Format = False .MatchCase = False .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With End Sub Sub serie() ' ' serie Makro ' Makro aufgezeichnet am 26.05.00 von IPTS03 ' _

NewMacros1 - 6 With ActiveDocument.MailMerge .Destination = wdSendToNewDocument .Execute End With Windows(2).Activate End Sub Sub Makro2() ' ' Makro2 Makro ' Makro aufgezeichnet am 29.05.00 von IPTS03 ' ActiveDocument.Sections(1).ProtectedForForms = True ActiveDocument.Sections(2).ProtectedForForms = False ActiveDocument.Protect Password:="test", NoReset:=False, Type:= _ wdAllowOnlyFormFields End Sub Sub datei_wahl() ' ' Makro3 Makro ' Makro aufgezeichnet am 29.05.00 von IPTS03 ' With Active.Document .Protect = True .Password = "Test" End With End Sub Sub adressbook() ' ' adressbook Makro ' Makro aufgezeichnet am 30.05.00 von IPTS03 ' WordBasic.InsertAddress End Sub Sub leerersetzen() ' ' leerersetzen Makro ' Makro aufgezeichnet am 18.09.00 von IPTS03 ' For i = 100 To 3 Step -1 x = Left$(" y = Left$(x, i - 1) Selection.Find.ClearFormatting Selection.Find.Replacement.ClearFormatting With Selection.Find .Text = x .Replacement.Text = y .Forward = True .Wrap = wdFindContinue .Format = False .MatchCase = False .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With Selection.Find.Execute Replace:=wdReplaceAll Next i End Sub Sub zweileerzutab() Selection.Find.ClearFormatting Selection.Find.Replacement.ClearFormatting With Selection.Find .Text = " " .Replacement.Text = "^t" .Forward = True .Wrap = wdFindContinue .Format = False .MatchCase = False .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With Selection.Find.Execute Replace:=wdReplaceAll

", i)

NewMacros1 - 7 End Sub Sub druck_eins(name) Documents.Open FileName:=name, ConfirmConversions:=False, _ ReadOnly:=False, AddToRecentFiles:=False, PasswordDocument:="", _ PasswordTemplate:="", Revert:=False, WritePasswordDocument:="", _ WritePasswordTemplate:="", Format:=wdOpenFormatAuto Application.PrintOut FileName:="", Range:=wdPrintAllDocument, Item:= _ wdPrintDocumentContent, Copies:=1, Pages:="", PageType:=wdPrintAllPages, _ Collate:=True, Background:=False, PrintToFile:=False, PrintZoomColumn:=0, _ PrintZoomRow:=0, PrintZoomPaperWidth:=0, PrintZoomPaperHeight:=0 ActiveDocument.Close End Sub Sub druck_alle_aus_einem_verzeichnis() Dim fs, f, f1, fc, s, t t = "U:\Buse" Set fs = CreateObject("Scripting.FileSystemObject") Set f = fs.GetFolder(t) Set fc = f.Files For Each f1 In fc s = t & "\" & f1.name Call druck_eins(s) Next End Sub Sub druckerfestlegen() x = ActivePrinter szDefault = GetDefaultPrinter() For Each Printer In Printers szName = Printer.DeviceName cbPrinters.AddItem szName If (0 = StrComp(szName, szDefault, vbTextCompare)) Then cbPrinters.ListIndex = cbPrinters.NewIndex End If Next End Sub

Sub grafik_rein() ' ' grafik_rein Makro ' Makro aufgezeichnet am 13.11.03 von IPT ' Selection.InlineShapes.AddPicture FileName:= _ "C:\Eigene Dateien\Meine Bilder\Freitag, September 19, 2003\~hpa0000.jpg" _ , LinkToFile:=False, SaveWithDocument:=True Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend Selection.InlineShapes(1).Fill.Visible = msoFalse Selection.InlineShapes(1).Fill.Transparency = 0# Selection.InlineShapes(1).Line.Weight = 0.75 Selection.InlineShapes(1).Line.Transparency = 0# Selection.InlineShapes(1).Line.Visible = msoFalse Selection.InlineShapes(1).LockAspectRatio = msoTrue Selection.InlineShapes(1).Height = 283.45 Selection.InlineShapes(1).Width = 387.2 Selection.InlineShapes(1).PictureFormat.Brightness = 0.5 Selection.InlineShapes(1).PictureFormat.Contrast = 0.5 Selection.InlineShapes(1).PictureFormat.ColorType = msoPictureAutomatic Selection.InlineShapes(1).PictureFormat.CropLeft = 0# Selection.InlineShapes(1).PictureFormat.CropRight = 0# Selection.InlineShapes(1).PictureFormat.CropTop = 0# Selection.InlineShapes(1).PictureFormat.CropBottom = 0# Selection.MoveRight Unit:=wdCharacter, Count:=1 Selection.MoveDown Unit:=wdLine, Count:=1, Extend:=wdExtend Selection.Delete Unit:=wdCharacter, Count:=1 Selection.MoveDown Unit:=wdLine, Count:=2 Selection.InsertBreak Type:=wdSectionBreakNextPage End Sub Sub gtgtgtgt() 'filetoopen = Application.GetOpenFilename("Grafiken (*.jpg), *.jpg") Selection.InlineShapes.AddPicture FileName:="C:\Eigene Dateien\ipt-blau.jpg", LinkToFile:=False , SaveWithDocument:=True Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend Selection.InlineShapes(1).ConvertToShape Selection.ShapeRange.Fill.Visible = msoFalse Selection.ShapeRange.Fill.Transparency = 0#

NewMacros1 - 8 Selection.ShapeRange.Line.Weight = 0.75 Selection.ShapeRange.Line.DashStyle = msoLineSolid Selection.ShapeRange.Line.Style = msoLineSingle Selection.ShapeRange.Line.Transparency = 0# Selection.ShapeRange.Line.Visible = msoFalse Selection.ShapeRange.LockAspectRatio = msoTrue Selection.ShapeRange.Height = 283.45 Selection.ShapeRange.Width = 387.5 Selection.ShapeRange.PictureFormat.Brightness = 0.5 Selection.ShapeRange.PictureFormat.Contrast = 0.5 Selection.ShapeRange.PictureFormat.ColorType = msoPictureAutomatic Selection.ShapeRange.PictureFormat.CropLeft = 0# Selection.ShapeRange.PictureFormat.CropRight = 0# Selection.ShapeRange.PictureFormat.CropTop = 0# Selection.ShapeRange.PictureFormat.CropBottom = 0# Selection.ShapeRange.RelativeHorizontalPosition = _ wdRelativeHorizontalPositionPage Selection.ShapeRange.RelativeVerticalPosition = _ wdRelativeVerticalPositionPage Selection.ShapeRange.Left = CentimetersToPoints(5) Selection.ShapeRange.Top = CentimetersToPoints(4) Selection.ShapeRange.LockAnchor = False Selection.ShapeRange.WrapFormat.AllowOverlap = True Selection.ShapeRange.WrapFormat.Side = wdWrapBoth Selection.ShapeRange.WrapFormat.DistanceTop = CentimetersToPoints(0) Selection.ShapeRange.WrapFormat.DistanceBottom = CentimetersToPoints(0) Selection.ShapeRange.WrapFormat.DistanceLeft = CentimetersToPoints(0.32) Selection.ShapeRange.WrapFormat.DistanceRight = CentimetersToPoints(0.32) Selection.ShapeRange.WrapFormat.Type = 3 Selection.ShapeRange.ZOrder 5 End Sub

Sub filesauf() Private Const Verzeichnis = "C:\Eigene Dateien" Private Const Filter = "*.doc" Sub DateiAuswaehlen() savEnv = Options.DefaultFilePath(wdCurrentFolderPath) On Error Resume Next Application.ChangeFileOpenDirectory Verzeichnis Fehler = Err.Number On Error GoTo 0 If Not Fehler = 0 And Not Fehler = 4172 Then MsgBox Err.Description, vbCritical, "Datei auswhlen" Exit Sub End If With Dialogs(wdDialogFileOpen) .name = Filter On Error Resume Next Dim Antwort As Boolean Antwort = .Display While Err.Number = 5174 MsgBox "Sie knnen ausschliesslich eine einzige Datei auswhlen.", _ vbExclamation, "Datei auswhlen" Err.Clear Antwort = .Display Wend Select Case Antwort Case -1 Datei = CurDir & "\" & .name MsgBox Datei, vbInformation, "Datei auswhlen." Case 0 MsgBox "Knacks." End Select End With On Error Resume Next Application.ChangeFileOpenDirectory savEnv 'restore folder on entry End Sub End Sub

Quindos_Dateien - 1 '-------------------------------------------------------------------------------------------Sub qds_to_doc() ' Makro zum Anpassen von Quindos-Anweisungstexten ' zum Ausdrucken ' Dokument als Winworddatei im gleichen Verzeichnis speichern Dim dateiname As String dateiname = ActiveDocument.FullName i = Len(dateiname) dateiname = Left$(dateiname, i - 4) + ".doc" ActiveDocument.saveas FileName:=dateiname, FileFormat:= _ wdFormatDocument, LockComments:=False, Password:="", AddToRecentFiles:= _ False, WritePassword:="", ReadOnlyRecommended:=False, EmbedTrueTypeFonts:= _ False, SaveNativePictureFormat:=False, SaveFormsData:=False, _ SaveAsAOCELetter:=False Selection.HomeKey Unit:=wdStory ' Alles markieren Selection.WholeStory ' Alles auf Kommentar setzen Selection.Style = ActiveDocument.Styles("qds-kommentar") ' Feststellen der Anzahl von Abstzen, nicht Linien, da ' Abstze komplett gendert werden sollen anz = Selection.Paragraphs.Count 'MsgBox "Anzahl der abstze: " & anz ' An den Beginn des Doks gehen Selection.HomeKey Unit:=wdStory For i = 1 To anz Selection.MoveDown Unit:=wdParagraph, Count:=1, Extend:=wdExtend x = Selection.Characters.Count If x > 2 Then char = Selection.Characters(1).Text char = char & Selection.Characters(2).Text Select Case char Case Is = "! ", "!=", "!-", "!*" Case Is = "**", "* " Case Is = " !" Selection.Style = ActiveDocument.Styles("qds-kommentar2") Case Else Selection.Style = ActiveDocument.Styles("qds-anweisung") End Select End If Selection.MoveRight Unit:=wdCharacter, Count:=1 Next i Call maxlin("*") Call maxlin("=") Call maxlin("-") Call maxlin(" ") Call maxlin2 Call pli 'Kopf und Fuzeilen einbauen With ActiveDocument.PageSetup .LineNumbering.Active = False .Orientation = wdOrientPortrait .TopMargin = CentimetersToPoints(2) .BottomMargin = CentimetersToPoints(1.5) .LeftMargin = CentimetersToPoints(2) .RightMargin = CentimetersToPoints(2) .Gutter = CentimetersToPoints(0) .HeaderDistance = CentimetersToPoints(1) .FooterDistance = CentimetersToPoints(1) .PageWidth = CentimetersToPoints(21) .PageHeight = CentimetersToPoints(29.7) .FirstPageTray = wdPrinterAutomaticSheetFeed .OtherPagesTray = wdPrinterAutomaticSheetFeed .SectionStart = wdSectionNewPage .OddAndEvenPagesHeaderFooter = False .DifferentFirstPageHeaderFooter = False .VerticalAlignment = wdAlignVerticalTop .SuppressEndnotes = False .MirrorMargins = False .TwoPagesOnOne = False .GutterPos = wdGutterPosLeft

Quindos_Dateien - 2 End With 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.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, Text:= _ "FILENAME \* Upper\p ", PreserveFormatting:=True Selection.Fields.Update If Selection.HeaderFooter.IsHeader = True Then ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageFooter Else ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader End If Selection.TypeText Text:=vbTab & vbTab NormalTemplate.AutoTextEntries("Seite X von Y").Insert Where:=Selection. _ Range Selection.EndKey Unit:=wdLine Selection.MoveLeft Unit:=wdWord, Count:=4, Extend:=wdExtend Selection.Fields.Update ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument If ActiveWindow.View.SplitSpecial = wdPaneNone Then ActiveWindow.ActivePane.View.Type = wdPrintView Else ActiveWindow.View.Type = wdPrintView End If ActiveDocument.Save With ActiveWindow.ActivePane.View.Zoom .PageColumns = 2 .PageRows = 1 End With Selection.HomeKey Unit:=wdStory MsgBox "Datei: " + dateiname + " gespeichert!" End Sub '-------------------------------------------------------------------------------------------Sub maxlin(ch As String) For i = 100 To 61 Step -1 st1 = String(i, ch) st2 = String(i - 1, ch) Selection.Find.ClearFormatting Selection.Find.Replacement.ClearFormatting With Selection.Find .Text = st1 .Replacement.Text = st2 .Forward = True .Wrap = wdFindContinue .Format = False .MatchCase = False .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With Selection.Find.Execute Replace:=wdReplaceAll Next i End Sub '-------------------------------------------------------------------------------------------Sub maxlin2() For i = 100 To 59 Step -1 st1 = "*" & String(i, " ") & "*" st2 = "*" & String(i - 1, " ") & "*" Selection.Find.ClearFormatting Selection.Find.Replacement.ClearFormatting With Selection.Find .Text = st1 .Replacement.Text = st2 .Forward = True .Wrap = wdFindContinue .Format = False .MatchCase = False

Quindos_Dateien - 3 .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With Selection.Find.Execute Replace:=wdReplaceAll Next i End Sub '-------------------------------------------------------------------------------------------Sub pli() st1 = "* P R O G R A M M " st2 = "* P R O G R A M M " Selection.Find.ClearFormatting Selection.Find.Replacement.ClearFormatting With Selection.Find .Text = st1 .Replacement.Text = st2 .Forward = True .Wrap = wdFindContinue .Format = False .MatchCase = False .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With Selection.Find.Execute Replace:=wdReplaceAll st1 = "- L I S T I N G *" st2 = "- L I S T I N G *" Selection.Find.ClearFormatting Selection.Find.Replacement.ClearFormatting With Selection.Find .Text = st1 .Replacement.Text = st2 .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 '--------------------------------------------------------------------------------------------

Schriften_anzeigen - 1 Sub Schriften_anzeigen() typ = InputBox("Kurzversion oder Langversion? 1 oder 2 ", "Auswahl", 1) If (typ = 1 Or typ = 2) Then Selection.WholeStory Selection.Delete Unit:=wdCharacter, Count:=1 Selection.Style = ActiveDocument.Styles("Standard") x = Application.FontNames.Count For i = 1 To x zzz = Application.FontNames(i) If typ = 1 Then Call rein2(zzz) Else Call rein1(zzz) End If Next i End If End Sub '-------------------------------------------------------------------------------------------Sub rein1(zzz) ' Selection.TypeText Text:="SCHRIFTNAME: " & zzz Selection.TypeText Text:=zzz Selection.HomeKey Unit:=wdLine, Extend:=wdExtend Selection.Style = ActiveDocument.Styles("Absatz-Standardschriftart") Selection.Font.Underline = wdUnderlineSingle Selection.Font.Bold = True Selection.EndKey Unit:=wdLine Selection.TypeParagraph Selection.Style = ActiveDocument.Styles("Absatz-Standardschriftart") Selection.TypeText Text:="ABCDEFGHIJKLMNOPQRSTUVWXYZ" Selection.HomeKey Unit:=wdLine, Extend:=wdExtend Selection.Font.name = zzz Selection.EndKey Unit:=wdLine Selection.TypeParagraph Selection.TypeText Text:="abcdefghijklmnopqrstuvwxyz" Selection.TypeParagraph Selection.TypeText Text:="1234567890<>,.-;:_+*~#^!$%&/()=?`'" Selection.TypeParagraph Selection.TypeParagraph End Sub '-------------------------------------------------------------------------------------------Sub rein2(zzz) Selection.TypeText Text:=zzz & " : " Selection.HomeKey Unit:=wdLine, Extend:=wdExtend Selection.Style = ActiveDocument.Styles("Absatz-Standardschriftart") Selection.Font.Underline = wdUnderlineSingle Selection.Font.Bold = True Selection.EndKey Unit:=wdLine Selection.TypeParagraph Selection.Style = ActiveDocument.Styles("Absatz-Standardschriftart") Selection.TypeText Text:="ABCDEFGH abcdefgh 1234567890" Selection.HomeKey Unit:=wdLine, Extend:=wdExtend Selection.Font.name = zzz Selection.EndKey Unit:=wdLine Selection.TypeParagraph Selection.TypeParagraph End Sub '--------------------------------------------------------------------------------------------

You might also like