View Single Post
Old 12-02-2012, 01:53 PM   #4
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
Found it. This will retain footnotes.

Code:
Private Sub cleancopy()
    Dim Style As Style
    Dim i As Integer

    Selection.WholeStory
    Selection.Cut

    For Each Style In ActiveDocument.Styles
        Style.Locked = True                           'alle stijlen blokkeren
    Next

    ActiveDocument.Styles(wdStyleNormal).Locked = False
    ActiveDocument.Protect Password:="password", NoReset:=False, Type:= _
                           wdNoProtection, UseIRM:=False, EnforceStyleLock:=True
    On Error Resume Next
    For i = ActiveDocument.Styles.count To 1 Step -1
        If ActiveDocument.Styles(i).Locked = True Then
            ActiveDocument.Styles(i).Delete
        End If
    Next i
    Selection.PasteAndFormat (wdFormatOriginalFormatting)
    ActiveDocument.Unprotect Password:="password"

End Sub
Toxaris is offline   Reply With Quote