Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Leerzeichen vor Zahl einfügen, VBA, Word 2000

Empfohlene Antworten

Veröffentlicht

Hallo,

ich würde gerne mit VBA für Word 2000 ein Word-Doc durchgehen und vor jeder Zeile, die mit einer Zahl (0-9) beginnt, ein Leerzeichen einfügen.

Kann mir jemand sagen, wie ich das mache?

Danke, Sebastian

Hab mir nun selbst geholfen :-)

Sub test()

Dim i As Integer

Dim t As String

i = 0

Selection.HomeKey Unit:=wdStory

Do

    Selection.MoveDown Unit:=wdLine, Count:=1, Extend:=wdMove

    Selection.HomeKey Unit:=wdLine

    i = i + 1

    Selection.MoveRight Unit:=wdCharacter, Count:=1, Extend:=wdExtend

    t = Selection.Text

    If Selection = "0" Or Selection = "1" Or _

        Selection = "2" Or Selection = "3" Or _

        Selection = "4" Or Selection = "5" Or _

        Selection = "6" Or Selection = "7" Or _

        Selection = "8" Or Selection = "9" Then

            Selection.HomeKey Unit:=wdLine

            Selection.TypeText Text:=" "

    End If

Loop Until (i = 100)

End Sub

Einziges Problem: ich zählen von i bis 100. Wie kann ich die 100 durch die Anzahl der Zeilen meiner Word-Datei ersetzen?

Danke Sebastian

Wüsste nicht wie das gehen soll. Jedenfalls solange es sich nicht um eine Tabelle handelt.

Die Anzahl der Zeilen steht in den Statistiken unter Dateieigenschaften, auszulesen mit: Dialogs(wdDialogFileSummaryInfo).NumLines

Easy... ;-)

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.