Sanjeev Sabhlok's notes on technology, hardware, gardening

Entire text has disappeared in Microsoft Word, only footnotes are visible

This has happened twice. A solution below (it is pretty complicated but works).

1. What happens is that while updating the table (F9) one might accidentally press Alt-F9, and then select all text. This converts it all into a field.

2. How to undo this is impossible manually. It requires a MACRO.

3. See this first – how to install a macro in the Word document:

4. Then install this macro:

Sub ExtractFieldCode()
    ' Jay Freedman
    Dim rg As range
    If ActiveDocument.Fields.Count = 0 Then
        MsgBox "This document contains no fields."
        Exit Sub
    End If
    With ActiveDocument
        .ActiveWindow.View.ShowFieldCodes = True
        .range.PasteSpecial DataType:=WdPasteDataType.wdPasteHTML
        .ActiveWindow.View.ShowFieldCodes = False
    End With
End Sub

5. Now run the macro!


Note: it is possible that a few problems might emerge in the text that has been retrieved. I had a to manuall fix some of these problems, but it was far better than re-typing material that I had lost.


View more posts from this author

Leave a Reply

Your email address will not be published. Required fields are marked *