Option
Explicit
Dim
intZeilenAnzahl
As
Integer
Const
strPW
As
String
=
"MM"
Private
Sub
DF_ZeilenAnzahl_SpinUp()
On
Error
GoTo
Ende
If
Not
ActiveDocument.ProtectionType = wdNoProtection
Then
ActiveDocument.Unprotect Password:=strPW
End
If
ThisDocument.Tables(2).Rows(ThisDocument.Tables(2).Rows.Count - 7).
Select
Selection.Copy
Selection.MoveLeft Unit:=wdCharacter, Count:=1
Selection.PasteAndFormat (wdFormatOriginalFormatting)
Ende:
ActiveDocument.Protect wdAllowOnlyFormFields, , Password:=strPW
End
Sub
Private
Sub
DF_ZeilenAnzahl_SpinDown()
On
Error
GoTo
Ende
If
Not
ActiveDocument.ProtectionType = wdNoProtection
Then
ActiveDocument.Unprotect Password:=strPW
End
If
Dim
strText
As
String
intZeilenAnzahl = ThisDocument.Tables(2).Rows(5).Cells.Count
If
intZeilenAnzahl > 1
Then
ThisDocument.Tables(2).Rows(3 + InputBox(
"Welche Themen-Zeile möchtest Du löschen?"
,
"Zeile löschen"
)).
Select
Selection.Copy
Selection.Cut
Else
MsgBox (
"Du kannst keine Zeile mehr löschen."
)
End
If
Ende:
ActiveDocument.Protect wdAllowOnlyFormFields, , Password:=strPW
End
Sub