Format Footnotes using range object instead of selection object.

A

andreas

Hello,

I wrote a macro to differently format footnotes 1-9 with a custom
footnote style (Dipl_FN_09). I did it using the selection object.
Could somebody please tell me how to re-write this macro using the
range object. I tried, but to no avail. Help is appreciated. Thank
you very much in advance.


Sub Dipl_Footnote_09()
Dim i As Byte

If ActiveWindow.ActivePane.View.Type = wdPrintView Or ActiveWindow. _
ActivePane.View.Type = wdWebView Or
ActiveWindow.ActivePane.View.Type = _
wdPrintPreview Then
ActiveWindow.View.SeekView = wdSeekFootnotes
Else
ActiveWindow.View.SplitSpecial = wdPaneFootnotes
End If

If ActiveDocument.Footnotes.Count >= 1 Then
Selection.GoTo What:=wdGoToFootnote, Which:=wdGoToFirst, Count:=1,
Name:=""

For i = 1 To 9
Selection.Style = ActiveDocument.Styles("Dipl_FN_09")
Selection.GoTo What:=wdGoToFootnote, Which:=wdGoToNext, Count:=1,
Name:=""
Next i


Exit Sub
 
J

Jezebel

Dim pIndex as long

For pIndex = 1 to 9
ActiveDocument.Footnotes(pIndex).Range.Style = "Dipl_FN_09"
Next
 

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