如何让Word文档内容折叠之VBA源代码
Admin
|
2008-9-11 20:22:07
|
TrackRecord:
2337
Times | Tag标签:Word教程
打印本页
您当前所处的位置是:〖首页〗→【文章页】
本站共有16个图文教程栏目,请用心拜读!
本站提供经典的Excel公式函数实例,Word排版技巧,PPT教程;同时更兼有Flash,PowerPoint,数据库等技术文章。
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
网上抄的,呵呵!
会员评论列表:

正在加载数据,请稍后……
针对本篇文章或本站,请您发表个人的建议或批评!