挺累的,以下代码供参考: '* +++++++++++++++++++++++++++++ '* Created By SHOUROU@ExcelHome 2007-1-20 8:33:52 '仅测试于System: Windows NT Word: 11.0 Language: 2052 '№ 0139^The Code CopyIn [ThisDocument-ThisDocument]^' '* ----------------------------- Option Explicit Dim GetNumber() As String, GetDate() As String, GetAuthor() As String, GetTitle() As String Dim myDate As String Sub Total() Dim myDialog As FileDialog, oDoc As Document, myPar As Paragraph Dim A As Variant, myTable As Table, myRow As Row, myRange As Range Dim myArray() As String, N As Integer, KeyArray() As Integer Dim FolderPath As String, KeyValue As Integer, M As Byte Dim I As Integer, J As Integer, Temp As String, TempA As String myDate = VBA.InputBox(prompt:="请正确输入截稿日期!" & vbCrLf & "例如:2007-1-20
或者
2007/1/20", _ Title:="ExcelHome_ShouRou", Default:=VBA.Format(Now, "YYYY-M-D")) If myDate = "" Then Exit Sub With Me .Content.Delete .Content.InsertAfter "汇总表" & Chr(13) .Content.InsertAfter "截稿日期:" & myDate End With Set myDialog = Application.FileDialog(msoFileDialogFilePicker) With myDialog .Filters.Clear '清除所有文件筛选器中的项目 .Filters.Add "所有 WORD 文件", "*.doc", 1 '增加筛选器的项目为所有WORD文件
|