Solved

How to delete all custom document properties from Word document?

Posted on 2010-09-10
2
682 Views
Last Modified: 2012-05-10
Hi I have dozens of word documents on dozens of laptops, each with about 150 custom document properties on them.

The custom document properties are causing errors with a Word plugin we are using and need to be deleted.

The problem is that when you open the custom document properties tab in Word 2007 (Microsoft Button > Prepare > Properties > Advanced Properties > Custom) there is no way to select multiple properties when deleting (ctrl+click and shift+click won't work).... so I would have to click each property and select delete for each document on each laptop.

I don't know much about VB scripting but is there a way to automate this process at least at the document level?
0
Comment
Question by:ob1_
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 8

Accepted Solution

by:
PandaPants earned 500 total points
ID: 33647151
Pretty simple, actually:
Public Sub DeleteAllCDPs()
    Dim xx As DocumentProperty
    For Each xx In ActiveDocument.CustomDocumentProperties
        xx.Delete
    Next xx
End Sub

Open in new window

0
 
LVL 6

Author Closing Comment

by:ob1_
ID: 33647320
Cool thanks!
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This article describes how to import an Outlook PST file to Office 365 using a third party product to avoid Microsoft's Azure command line tool, saving you time.
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question