?
Solved

Bulk change "Field" variable in Word

Posted on 2014-11-30
5
Medium Priority
?
359 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 52

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 2000 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

Veeam Task Manager for Hyper-V

Task Manager for Hyper-V provides critical information that allows you to monitor Hyper-V performance by displaying real-time views of CPU and memory at the individual VM-level, so you can quickly identify which VMs are using host resources.

Question has a verified solution.

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

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
I was prompted to write this article after the recent World-Wide Ransomware outbreak. For years now, System Administrators around the world have used the excuse of "Waiting a Bit" before applying Security Patch Updates. This type of reasoning to me …
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 …
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…

770 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