Solved

Bulk change "Field" variable in Word

Posted on 2014-11-30
5
296 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
  • 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 48

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

I would like to show you some basics you can do with Mailings in MS Word. It´s quite handy feature you can use for creating envelopes, labels, personalized letters etc. First question could be what is this feature good for? Mailing can really he…
My experience with Windows 10 over a one year period and suggestions for smooth operation
In a previous video Micro Tutorial here at Experts Exchange (http://www.experts-exchange.com/videos/1358/How-to-get-a-free-trial-of-Office-365-with-the-Office-2016-desktop-applications.html), I explained how to get a free, one-month trial of Office …
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 …

746 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

12 Experts available now in Live!

Get 1:1 Help Now