0
我想用VBA创建一个包含带有文档评论页面的新文档。我只发现这个宏创建一个只列出评论的文档。我需要评论页面。如何修改它?提前致谢!如何使用页面和注释创建新的Word文档?
Sub PrintOnlyComments()
Dim oThisDoc As Document
Dim oThatDoc As Document
Dim c As Comment
Dim sTemp As String
Dim iPage As Integer
Set oThisDoc = ActiveDocument
Set oThatDoc = Documents.Add
Application.ScreenUpdating = False
For Each c In oThisDoc.Comments
'Find page number of comment
oThisDoc.Select
c.Reference.Select
iPage = Selection.Information(wdActiveEndAdjustedPageNumber)
'Put info in new document
oThatDoc.Select
Selection.EndKey Unit:=wdStory
sTemp = "Page: " & iPage
Selection.TypeText Text:=sTemp
Selection.TypeParagraph
sTemp = "[" & c.Initial & c.Index & "] " & c.Range
Selection.TypeText Text:=sTemp
Selection.TypeParagraph
Next
Application.ScreenUpdating = True
End Sub
也许你想要一个模板? '.docm'扩展我的意思是.http://filext.com/file-extension/DOCM – SerCrAsH