Προς το περιεχόμενο

Αντιστροφή Numbering σε MS Word


Stuff

Προτεινόμενες αναρτήσεις

Δημοσ.

1. Φτιάξε την παρακάτω macro

2. Επέλεξε το κείμενο που θες

3. Βάλε το numbering του Word

4. Τρέξε την macro

5. Βγάλε το numbering του Word

 

Sub RevList()

Dim ShowFlag As Boolean

Dim Numparas As Integer

Dim Counter As Integer

 

Numparas = Selection.Paragraphs.Count

Selection.MoveLeft Unit:=wdCharacter, Count:=1

ShowFlag = ActiveWindow.View.ShowFieldCodes

ActiveWindow.View.ShowFieldCodes = True

DoList Numparas

Counter = 1

While Counter < Numparas

Selection.Move Unit:=wdParagraph, Count:=1

DoList Numparas

Counter = Counter + 1

Wend

ActiveWindow.View.ShowFieldCodes = ShowFlag

ActiveDocument.Select

ActiveDocument.Fields.Update

End Sub

 

Private Sub DoList(Cnt As Integer)

Selection.Extend

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

If InStr(Selection.Text, "SEQ") > 0 Then

Selection.MoveRight Unit:=wdCharacter, Count:=2

Selection.Delete Unit:=wdCharacter, Count:=1

Else

Selection.Collapse Direction:=wdCollapseStart

End If

Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, _

PreserveFormatting:=False

Selection.TypeText Text:="=" & Cnt + 1 & "-"

Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, _

PreserveFormatting:=False

Selection.TypeText Text:="SEQ RevList"

With Selection.ParagraphFormat

.LeftIndent = InchesToPoints(0.5)

.FirstLineIndent = InchesToPoints(-0.5)

End With

Selection.MoveRight Unit:=wdCharacter, Count:=4

Selection.InsertAfter "." & vbTab

End Sub

Αρχειοθετημένο

Αυτό το θέμα έχει αρχειοθετηθεί και είναι κλειστό για περαιτέρω απαντήσεις.

  • Δημιουργία νέου...