How to transform all comments to footnotes?

A

avkokin

Hello.
There is a document which has many the comments. I need to transform
these comments to the footnotes (normal). How?
Thank you.
 
H

Helmut Weber

Hi Anton,

perhaps you can adapt the following to your needs.

Sub Macro8()

Dim oCmt As Comment
Dim rDcm As Range
Dim rTmp As Range ' the comment's scope
Dim oFtn As Footnote
Set rDcm = ActiveDocument.Range

With rDcm
With .FootnoteOptions
.Location = wdBottomOfPage
.NumberingRule = wdRestartContinuous
.StartingNumber = 1
.NumberStyle = wdNoteNumberStyleArabic
End With
For Each oCmt In .Comments
Set rTmp = oCmt.Scope
Set oFtn = .Footnotes.Add(Range:=rTmp, Reference:="")
oFtn.Range.Text = oCmt.Range.Text
oCmt.Delete
Next
End With
End Sub

--

Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Vista Small Business, Office XP
 
S

StevenM

To: A.V. Kokin,

Sub Comments2Footnotes()
Dim actDoc As Document
Dim oRange As Range
Dim comm As String
Dim fn As Footnote
Dim i As Long

Set actDoc = ActiveDocument
For i = actDoc.Comments.count To 1 Step -1
comm = actDoc.Comments(i).Range.text
Set oRange = actDoc.Comments(i).Scope
oRange.Collapse CollapseEnd
actDoc.Comments(i).Delete
Set fn = actDoc.Footnotes.Add(oRange)
fn.Range.text = comm
Next i
End Sub

Steven Craig Miller
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top