Solved

Bulk change "Field" variable in Word

Posted on 2014-11-30
5
345 Views
Last Modified: 2014-12-09
I am updating some of our internal documentation.

I use a number of "DocProperty" or Advanced Property\Custom variables in my document.

I am trying to re-organise and standardise naming.

What I need to do is replace all fields with the "DocProperty" value of "IPADDRESS" to the new "DocProperty" value of "1IPADDRESS"

I can manually go thru, select the field, change but with a LOT of these that is very painful.

Wondering if there is a way to make this process a bit easier.

I am using MS Word 2013 SP1
0
Comment
Question by:naughtynat
[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
  • 3
5 Comments
 
LVL 6

Author Comment

by:naughtynat
ID: 40473100
Also, I thought I might be able to change the name of the variable, but if I do that it will just add a new variable so unfortunately that isn't possible.
0
 
LVL 51

Expert Comment

by:Rgonzo1971
ID: 40473155
Hi,

You can change the variable Name with VBA without adding a property

ActiveDocument.CustomDocumentProperties("IPADDRESS").Name = "1IPADDRESS"

Regards
0
 
LVL 6

Author Comment

by:naughtynat
ID: 40476715
Thanks,

Sorry I think I wasnt very clear, is there a way to replace the field in the document.

I have in the document both IPADDRESS and 1IPADDRESS.

I want to change any field variables that are looking at "IPADDRESS" to be changed to "1IPADDRESS"

Not sure if that makes sense.
0
 
LVL 6

Accepted Solution

by:
Let's Go earned 500 total points
ID: 40477841
I think this is what you want:

1. Display all field names (e.g. ctrl-a to select the whole document, then shift-F9 to display field names)

2. Use search and replace to make the change you want.  You should search for both
DOCPROPERTY(space)IPADDRESS

Open in new window

and
DOCPROPERTY(space)(space)IPADDRESS

Open in new window

where (space) refers to pressing the space bar, and replace with
DOCPROPERTY(space)1IPADDRESS

Open in new window


Note: If IPADDRESS is only ever used in DOCPROPERTY fields, then you could just search-and-replace for IPADDRESS.

3. Reverse step 1 to show field results (e.g. again press ctrl-a to select the whole document, then shift-F9 to display field names)

If you want, you could put this into a macro.
Clipboard01.jpg
0
 
LVL 6

Author Closing Comment

by:naughtynat
ID: 40489216
Thanks very much, that has done the job very nicely :-)
0

Featured Post

Office 365 Training for IT Pros

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

Question has a verified solution.

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

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
Outlook for dependable use in a very small business   This article is about using the Outlook application (part of Microsoft Office) in a very small business, or for homeowners where dependability and reliability are critical requirements. This …
Learn how to make your own table of contents in Microsoft Word using paragraph styles and the automatic table of contents tool. We'll be using the paragraph styles in Word’s Home toolbar to help you create a table of contents. Type out your initial …
Learn how to create and modify your own paragraph styles in Microsoft Word. This can be helpful when wanting to make consistently referenced styles throughout a document or template.

690 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