Share via

Convert document properties to text?

Anonymous
2014-11-17T13:50:27+00:00

Is it possible to convert document property values to plain text?  I need to create a macro to select all doc properties in the document & convert them to plain text and can't figure out a way to do that (it doesn't convert when I treat it like a field & use Alt-A (to select all) followed by Ctrl-Shift-F9 (to convert field to text). 

Thank you for you help!

Microsoft 365 and Office | Word | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Anonymous
2014-11-17T14:08:35+00:00

Many of the document properties inserted with UI are inserted as content controls (not fields).  You can convert content controls to text with VBA:

Sub ScratchMacro()

'A basic Word macro coded by Greg Maxey

Dim oCC As ContentControl

  For Each oCC In ActiveDocument.ContentControls

    oCC.Delete

  Next oCC

End Sub

or you can use:

http://gregmaxey.mvps.org/word_tip_pages/content_control_tools.html

Was this answer helpful?

4 people found this answer helpful.
0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Anonymous
    2014-11-17T22:44:44+00:00

    Johasia,

    Unless I missed it, the add-in accommodates locked CCs for the purposes of deleting/converting to text.  Give it a try.

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2014-11-17T22:41:56+00:00

    Thanks so much, Greg!

    This is perfect!

    It errored out on a few properties because they were locked but I was able to manually select them & use Developer tab > Properties to clear the locked for deletion checkbox.

    Was this answer helpful?

    0 comments No comments