Solved

How to delete all custom document properties from Word document?

Posted on 2010-09-10
2
676 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_
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Preface: When I started this series, I used the term CommandBars because that is the Office Object class that it discusses. Unfortunately, when Microsoft introduced Office 2007, they replaced the standard Commandbar menus with "The Ribbon" and rem…
PaperPort has a feature called the "Send To Bar". It provides a convenient, drag-and-drop interface for using other installed software, such as Microsoft Office. However, this article shows that the latest Office 2016 apps (installed with an Office …
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …

863 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now