How to have the same text in multiple places be changed or refactored at once?
I have a document with a variable being referred to several times on different pages. This is the same variable and so its value is the same on each page. If I need to change this variable I would like to be able change it only in one place and have this change all the other instances of this variable. Similar to when you refactor a variable in code. I can do a find and replace, but the problem is when I have several variables with the same value the find and replace will not differentiate between them, meaning I would need to click through every instance manually and decide if to replace that instance or not.
Is there a way to insert text or mark it in some way so that the document knows that this piece of text is the same as other instances and that changing one changes all others. This is similar to how text in the header and footers work, where changing one header changes all of them, except this would be in the body of the document.
microsoft-word
add a comment |
I have a document with a variable being referred to several times on different pages. This is the same variable and so its value is the same on each page. If I need to change this variable I would like to be able change it only in one place and have this change all the other instances of this variable. Similar to when you refactor a variable in code. I can do a find and replace, but the problem is when I have several variables with the same value the find and replace will not differentiate between them, meaning I would need to click through every instance manually and decide if to replace that instance or not.
Is there a way to insert text or mark it in some way so that the document knows that this piece of text is the same as other instances and that changing one changes all others. This is similar to how text in the header and footers work, where changing one header changes all of them, except this would be in the body of the document.
microsoft-word
add a comment |
I have a document with a variable being referred to several times on different pages. This is the same variable and so its value is the same on each page. If I need to change this variable I would like to be able change it only in one place and have this change all the other instances of this variable. Similar to when you refactor a variable in code. I can do a find and replace, but the problem is when I have several variables with the same value the find and replace will not differentiate between them, meaning I would need to click through every instance manually and decide if to replace that instance or not.
Is there a way to insert text or mark it in some way so that the document knows that this piece of text is the same as other instances and that changing one changes all others. This is similar to how text in the header and footers work, where changing one header changes all of them, except this would be in the body of the document.
microsoft-word
I have a document with a variable being referred to several times on different pages. This is the same variable and so its value is the same on each page. If I need to change this variable I would like to be able change it only in one place and have this change all the other instances of this variable. Similar to when you refactor a variable in code. I can do a find and replace, but the problem is when I have several variables with the same value the find and replace will not differentiate between them, meaning I would need to click through every instance manually and decide if to replace that instance or not.
Is there a way to insert text or mark it in some way so that the document knows that this piece of text is the same as other instances and that changing one changes all others. This is similar to how text in the header and footers work, where changing one header changes all of them, except this would be in the body of the document.
microsoft-word
microsoft-word
asked May 7 '17 at 2:25
FrontEndFrontEnd
12814
12814
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
A standard way to handle repeated text is to use bookmarks in conjunction with REF
fields. Each bit of repeated text is stored in a bookmark, and each repetition of that text is inserted via a REF
field that is linked to the bookmark. So it doesn't matter if two bookmarks happen to store identical looking text at a given time.
- Select the text that needs to be repeated, and insert a bookmark (on the Insert tab, in the Links group, click Bookmark).
- At each place where you need the text repeated, insert a
REF
field (on the Insert tab, in the Text group, click Quick Parts > Field, select Ref, and then select the name of the bookmark in the list). - After you change the bookmarked text, select the whole document, and then press F9 to update the
REF
fields.
As came up in another recent question, it helps if you make bookmarks visible if they aren't (click File > Options > Advanced, and then, under Show document content, select Show bookmarks). Otherwise, when you change the text, some of the new text might end up outside the bookmark, and your changes won't be propagated. When the bookmarks are visible, you can see whether all the new text is correctly inside the bookmark.
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1206774%2fhow-to-have-the-same-text-in-multiple-places-be-changed-or-refactored-at-once%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
A standard way to handle repeated text is to use bookmarks in conjunction with REF
fields. Each bit of repeated text is stored in a bookmark, and each repetition of that text is inserted via a REF
field that is linked to the bookmark. So it doesn't matter if two bookmarks happen to store identical looking text at a given time.
- Select the text that needs to be repeated, and insert a bookmark (on the Insert tab, in the Links group, click Bookmark).
- At each place where you need the text repeated, insert a
REF
field (on the Insert tab, in the Text group, click Quick Parts > Field, select Ref, and then select the name of the bookmark in the list). - After you change the bookmarked text, select the whole document, and then press F9 to update the
REF
fields.
As came up in another recent question, it helps if you make bookmarks visible if they aren't (click File > Options > Advanced, and then, under Show document content, select Show bookmarks). Otherwise, when you change the text, some of the new text might end up outside the bookmark, and your changes won't be propagated. When the bookmarks are visible, you can see whether all the new text is correctly inside the bookmark.
add a comment |
A standard way to handle repeated text is to use bookmarks in conjunction with REF
fields. Each bit of repeated text is stored in a bookmark, and each repetition of that text is inserted via a REF
field that is linked to the bookmark. So it doesn't matter if two bookmarks happen to store identical looking text at a given time.
- Select the text that needs to be repeated, and insert a bookmark (on the Insert tab, in the Links group, click Bookmark).
- At each place where you need the text repeated, insert a
REF
field (on the Insert tab, in the Text group, click Quick Parts > Field, select Ref, and then select the name of the bookmark in the list). - After you change the bookmarked text, select the whole document, and then press F9 to update the
REF
fields.
As came up in another recent question, it helps if you make bookmarks visible if they aren't (click File > Options > Advanced, and then, under Show document content, select Show bookmarks). Otherwise, when you change the text, some of the new text might end up outside the bookmark, and your changes won't be propagated. When the bookmarks are visible, you can see whether all the new text is correctly inside the bookmark.
add a comment |
A standard way to handle repeated text is to use bookmarks in conjunction with REF
fields. Each bit of repeated text is stored in a bookmark, and each repetition of that text is inserted via a REF
field that is linked to the bookmark. So it doesn't matter if two bookmarks happen to store identical looking text at a given time.
- Select the text that needs to be repeated, and insert a bookmark (on the Insert tab, in the Links group, click Bookmark).
- At each place where you need the text repeated, insert a
REF
field (on the Insert tab, in the Text group, click Quick Parts > Field, select Ref, and then select the name of the bookmark in the list). - After you change the bookmarked text, select the whole document, and then press F9 to update the
REF
fields.
As came up in another recent question, it helps if you make bookmarks visible if they aren't (click File > Options > Advanced, and then, under Show document content, select Show bookmarks). Otherwise, when you change the text, some of the new text might end up outside the bookmark, and your changes won't be propagated. When the bookmarks are visible, you can see whether all the new text is correctly inside the bookmark.
A standard way to handle repeated text is to use bookmarks in conjunction with REF
fields. Each bit of repeated text is stored in a bookmark, and each repetition of that text is inserted via a REF
field that is linked to the bookmark. So it doesn't matter if two bookmarks happen to store identical looking text at a given time.
- Select the text that needs to be repeated, and insert a bookmark (on the Insert tab, in the Links group, click Bookmark).
- At each place where you need the text repeated, insert a
REF
field (on the Insert tab, in the Text group, click Quick Parts > Field, select Ref, and then select the name of the bookmark in the list). - After you change the bookmarked text, select the whole document, and then press F9 to update the
REF
fields.
As came up in another recent question, it helps if you make bookmarks visible if they aren't (click File > Options > Advanced, and then, under Show document content, select Show bookmarks). Otherwise, when you change the text, some of the new text might end up outside the bookmark, and your changes won't be propagated. When the bookmarks are visible, you can see whether all the new text is correctly inside the bookmark.
answered May 7 '17 at 4:00
cnreadcnread
1,791248
1,791248
add a comment |
add a comment |
Thanks for contributing an answer to Super User!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1206774%2fhow-to-have-the-same-text-in-multiple-places-be-changed-or-refactored-at-once%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown