Solved

How to delete all custom document properties from Word document?

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Not long ago I saw a question in the VB Script forum that I thought would not take much time. You can read that question (Question ID  (http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_28455246.html)28455246) Here (http…
My experience with Windows 10 over a one year period and suggestions for smooth operation
This video shows where to find templates, what they are used for, and how to create and save a custom template using Microsoft Word.
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…

747 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

13 Experts available now in Live!

Get 1:1 Help Now