• Anonymizing a Word doc for posting (All versions)

    Home » Forums » AskWoody support » Productivity software by function » MS Word and word processing help » Anonymizing a Word doc for posting (All versions)

    Author
    Topic
    #418207

    Posters here often wish to attach sample docs, but need to remove sensitive content. I recently needed to do the same, so came up with this quick hack. It replaces every paragraph in a document with the standard Rand() text — “The Quick Brown Fox Jumps Over The Lazy Dog” — but retains the paragraph’s style.

    Enjoy!

    Sub RandifyActiveDocument()
    Dim para As Paragraph
    Dim rng As Range
    For Each para In ActiveDocument.Paragraphs
        If para.Range.Characters.count > 1 Then
            Set rng = para.Range
            rng.MoveEnd unit:=wdCharacter, count:=-1
            rng.Text = "The Quick Brown Fox Jumps Over The Lazy Dog"
        End If
    Next para
    End Sub
    

    Note that this doesn’t affect the headers/footers, and doesn’t remove comments, tracked changes, etc. (Though if someone wants to add that, sounds like a nice idea.)

    Viewing 0 reply threads
    Author
    Replies
    • #940539

      Thank you Andrew for this post. We will all find it helpful.

      ACM

    Viewing 0 reply threads
    Reply To: Anonymizing a Word doc for posting (All versions)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: