Option Explicit Sub Example1() Dim MyRange As Range With Selection ActiveDocument.AttachedTemplate.AutoTextEntries("展开").Insert .Range .Paragraphs(1).Next.Range.Font.Hidden = False End With End Sub '---------------------- Sub Example2() Dim MyRange As Range With Selection ActiveDocument.AttachedTemplate.AutoTextEntries("折叠").Insert .Range Set MyRange = ThisDocument.Range(.Paragraphs(1).Next(1).Range.Start, .Paragraphs(1).Next(2).Range.End) MyRange.Font.Hidden = True End With End Sub '----------------------
Private Sub Document_Close() Options.ButtonFieldClicks = 2 End Sub '----------------------
Private Sub Document_New() Application.OrganizerCopy End Sub '----------------------
Private Sub Document_Open() With ActiveDocument.ActiveWindow .View.ShowAll = False .View.ShowHiddenText = False End With Options.ButtonFieldClicks = 1 End Sub