MS Word: Using Formulas with Custom Doc Properties
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}
Anyone know how to add 1 to a custom document property? For some reason this really simple equation escapes me. I have a custom property, Document_Number, saved as a Number format. When revealing field codes, I've tried these lines:
{ = { DOCPROPERTY "Document_Number" * MERGEFORMAT } + 1 }
{ = { DOCPROPERTY "Document_Number" * MERGEFORMAT + 1} }
{ = { DOCPROPERTY "Document_Number" +1 * MERGEFORMAT } }
Books don't seem to cover this. Google doesn't seem to cover this. What am I doing wrong? I just want to add 1 to the document property. This can't be that hard to put together a formula, right?
microsoft-word vba
migrated from stackoverflow.com Aug 5 '16 at 16:37
This question came from our site for professional and enthusiast programmers.
add a comment |
Anyone know how to add 1 to a custom document property? For some reason this really simple equation escapes me. I have a custom property, Document_Number, saved as a Number format. When revealing field codes, I've tried these lines:
{ = { DOCPROPERTY "Document_Number" * MERGEFORMAT } + 1 }
{ = { DOCPROPERTY "Document_Number" * MERGEFORMAT + 1} }
{ = { DOCPROPERTY "Document_Number" +1 * MERGEFORMAT } }
Books don't seem to cover this. Google doesn't seem to cover this. What am I doing wrong? I just want to add 1 to the document property. This can't be that hard to put together a formula, right?
microsoft-word vba
migrated from stackoverflow.com Aug 5 '16 at 16:37
This question came from our site for professional and enthusiast programmers.
Assumed I could do math calculations on user-defined properties if it was a numeric type. Does anyone know a property I can use to show the number of a document in a series of documents that I can add 1 to?
– Steve G.
Aug 11 '16 at 19:36
If you’re trying to change the document property, the answer that says “You can’t” is right. But if you’re just trying to display the result of a computation involving a document property as a term — your first option ({ = { DOCPROPERTY "Document_Number" * MERGEFORMAT } +1 }) worked for me (in Word 2013).
– Scott
Jul 24 '18 at 4:08
add a comment |
Anyone know how to add 1 to a custom document property? For some reason this really simple equation escapes me. I have a custom property, Document_Number, saved as a Number format. When revealing field codes, I've tried these lines:
{ = { DOCPROPERTY "Document_Number" * MERGEFORMAT } + 1 }
{ = { DOCPROPERTY "Document_Number" * MERGEFORMAT + 1} }
{ = { DOCPROPERTY "Document_Number" +1 * MERGEFORMAT } }
Books don't seem to cover this. Google doesn't seem to cover this. What am I doing wrong? I just want to add 1 to the document property. This can't be that hard to put together a formula, right?
microsoft-word vba
Anyone know how to add 1 to a custom document property? For some reason this really simple equation escapes me. I have a custom property, Document_Number, saved as a Number format. When revealing field codes, I've tried these lines:
{ = { DOCPROPERTY "Document_Number" * MERGEFORMAT } + 1 }
{ = { DOCPROPERTY "Document_Number" * MERGEFORMAT + 1} }
{ = { DOCPROPERTY "Document_Number" +1 * MERGEFORMAT } }
Books don't seem to cover this. Google doesn't seem to cover this. What am I doing wrong? I just want to add 1 to the document property. This can't be that hard to put together a formula, right?
microsoft-word vba
microsoft-word vba
edited Aug 6 '16 at 7:04
dbmitch
1348
1348
asked Aug 4 '16 at 23:58
Steve G.Steve G.
65
65
migrated from stackoverflow.com Aug 5 '16 at 16:37
This question came from our site for professional and enthusiast programmers.
migrated from stackoverflow.com Aug 5 '16 at 16:37
This question came from our site for professional and enthusiast programmers.
Assumed I could do math calculations on user-defined properties if it was a numeric type. Does anyone know a property I can use to show the number of a document in a series of documents that I can add 1 to?
– Steve G.
Aug 11 '16 at 19:36
If you’re trying to change the document property, the answer that says “You can’t” is right. But if you’re just trying to display the result of a computation involving a document property as a term — your first option ({ = { DOCPROPERTY "Document_Number" * MERGEFORMAT } +1 }) worked for me (in Word 2013).
– Scott
Jul 24 '18 at 4:08
add a comment |
Assumed I could do math calculations on user-defined properties if it was a numeric type. Does anyone know a property I can use to show the number of a document in a series of documents that I can add 1 to?
– Steve G.
Aug 11 '16 at 19:36
If you’re trying to change the document property, the answer that says “You can’t” is right. But if you’re just trying to display the result of a computation involving a document property as a term — your first option ({ = { DOCPROPERTY "Document_Number" * MERGEFORMAT } +1 }) worked for me (in Word 2013).
– Scott
Jul 24 '18 at 4:08
Assumed I could do math calculations on user-defined properties if it was a numeric type. Does anyone know a property I can use to show the number of a document in a series of documents that I can add 1 to?
– Steve G.
Aug 11 '16 at 19:36
Assumed I could do math calculations on user-defined properties if it was a numeric type. Does anyone know a property I can use to show the number of a document in a series of documents that I can add 1 to?
– Steve G.
Aug 11 '16 at 19:36
If you’re trying to change the document property, the answer that says “You can’t” is right. But if you’re just trying to display the result of a computation involving a document property as a term — your first option (
{ = { DOCPROPERTY "Document_Number" * MERGEFORMAT } +1 }) worked for me (in Word 2013).– Scott
Jul 24 '18 at 4:08
If you’re trying to change the document property, the answer that says “You can’t” is right. But if you’re just trying to display the result of a computation involving a document property as a term — your first option (
{ = { DOCPROPERTY "Document_Number" * MERGEFORMAT } +1 }) worked for me (in Word 2013).– Scott
Jul 24 '18 at 4:08
add a comment |
2 Answers
2
active
oldest
votes
You can't update the value of a Custom Document Property using a field code.
In principle, it might look as if you could do it by making it a linked property, i.e. connected to the value of a bookmark, and update the content of the bookmark. But AFAICS it doesn't actually work.
You can update the value of the AUTHOR, TITLE, SUBJECT, KEYWORDS and COMMENTS builtin document properties using a field construction, e.g. for AUTHOR you could use:
{ AUTHOR { ={ AUTHOR }+1 } }
(If you literally mean that you can't take a Custom Document Property and display "1+its value", you have probably used the {} you can type on the keyboard for at least one of the brace pairs, instead of the special field code braces that you can insert using ctrl-F9 in Windows Word.)
I typed in the above formula (subsituting AUTHOR for DOCPROPERTY "Document number") and I used Ctrl+F9 to insert the braces instead of typing them, but no dice. The document number displayed the current number, but no incrementation. But, like was discussed above, I guess you just can't perform math on custom properties, numeric or not. :/
– Steve G.
Aug 11 '16 at 23:01
add a comment |
I got this to work:
- Insert field and add your custom doc property:
{ DOCPROPERTY "Document_Number"}
- Insert a second field as a formula field. Make it a simple one e.g.,
{=1+2}
- Toggle field codes for both fields
- Copy the first field, paste it over the "2" within the second field code
- Update fields
Voilà
Check by editing your custom doc property from with in the properties menu and then do a blanket field update
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%2f1110283%2fms-word-using-formulas-with-custom-doc-properties%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
You can't update the value of a Custom Document Property using a field code.
In principle, it might look as if you could do it by making it a linked property, i.e. connected to the value of a bookmark, and update the content of the bookmark. But AFAICS it doesn't actually work.
You can update the value of the AUTHOR, TITLE, SUBJECT, KEYWORDS and COMMENTS builtin document properties using a field construction, e.g. for AUTHOR you could use:
{ AUTHOR { ={ AUTHOR }+1 } }
(If you literally mean that you can't take a Custom Document Property and display "1+its value", you have probably used the {} you can type on the keyboard for at least one of the brace pairs, instead of the special field code braces that you can insert using ctrl-F9 in Windows Word.)
I typed in the above formula (subsituting AUTHOR for DOCPROPERTY "Document number") and I used Ctrl+F9 to insert the braces instead of typing them, but no dice. The document number displayed the current number, but no incrementation. But, like was discussed above, I guess you just can't perform math on custom properties, numeric or not. :/
– Steve G.
Aug 11 '16 at 23:01
add a comment |
You can't update the value of a Custom Document Property using a field code.
In principle, it might look as if you could do it by making it a linked property, i.e. connected to the value of a bookmark, and update the content of the bookmark. But AFAICS it doesn't actually work.
You can update the value of the AUTHOR, TITLE, SUBJECT, KEYWORDS and COMMENTS builtin document properties using a field construction, e.g. for AUTHOR you could use:
{ AUTHOR { ={ AUTHOR }+1 } }
(If you literally mean that you can't take a Custom Document Property and display "1+its value", you have probably used the {} you can type on the keyboard for at least one of the brace pairs, instead of the special field code braces that you can insert using ctrl-F9 in Windows Word.)
I typed in the above formula (subsituting AUTHOR for DOCPROPERTY "Document number") and I used Ctrl+F9 to insert the braces instead of typing them, but no dice. The document number displayed the current number, but no incrementation. But, like was discussed above, I guess you just can't perform math on custom properties, numeric or not. :/
– Steve G.
Aug 11 '16 at 23:01
add a comment |
You can't update the value of a Custom Document Property using a field code.
In principle, it might look as if you could do it by making it a linked property, i.e. connected to the value of a bookmark, and update the content of the bookmark. But AFAICS it doesn't actually work.
You can update the value of the AUTHOR, TITLE, SUBJECT, KEYWORDS and COMMENTS builtin document properties using a field construction, e.g. for AUTHOR you could use:
{ AUTHOR { ={ AUTHOR }+1 } }
(If you literally mean that you can't take a Custom Document Property and display "1+its value", you have probably used the {} you can type on the keyboard for at least one of the brace pairs, instead of the special field code braces that you can insert using ctrl-F9 in Windows Word.)
You can't update the value of a Custom Document Property using a field code.
In principle, it might look as if you could do it by making it a linked property, i.e. connected to the value of a bookmark, and update the content of the bookmark. But AFAICS it doesn't actually work.
You can update the value of the AUTHOR, TITLE, SUBJECT, KEYWORDS and COMMENTS builtin document properties using a field construction, e.g. for AUTHOR you could use:
{ AUTHOR { ={ AUTHOR }+1 } }
(If you literally mean that you can't take a Custom Document Property and display "1+its value", you have probably used the {} you can type on the keyboard for at least one of the brace pairs, instead of the special field code braces that you can insert using ctrl-F9 in Windows Word.)
answered Aug 5 '16 at 10:25
user181946
I typed in the above formula (subsituting AUTHOR for DOCPROPERTY "Document number") and I used Ctrl+F9 to insert the braces instead of typing them, but no dice. The document number displayed the current number, but no incrementation. But, like was discussed above, I guess you just can't perform math on custom properties, numeric or not. :/
– Steve G.
Aug 11 '16 at 23:01
add a comment |
I typed in the above formula (subsituting AUTHOR for DOCPROPERTY "Document number") and I used Ctrl+F9 to insert the braces instead of typing them, but no dice. The document number displayed the current number, but no incrementation. But, like was discussed above, I guess you just can't perform math on custom properties, numeric or not. :/
– Steve G.
Aug 11 '16 at 23:01
I typed in the above formula (subsituting AUTHOR for DOCPROPERTY "Document number") and I used Ctrl+F9 to insert the braces instead of typing them, but no dice. The document number displayed the current number, but no incrementation. But, like was discussed above, I guess you just can't perform math on custom properties, numeric or not. :/
– Steve G.
Aug 11 '16 at 23:01
I typed in the above formula (subsituting AUTHOR for DOCPROPERTY "Document number") and I used Ctrl+F9 to insert the braces instead of typing them, but no dice. The document number displayed the current number, but no incrementation. But, like was discussed above, I guess you just can't perform math on custom properties, numeric or not. :/
– Steve G.
Aug 11 '16 at 23:01
add a comment |
I got this to work:
- Insert field and add your custom doc property:
{ DOCPROPERTY "Document_Number"}
- Insert a second field as a formula field. Make it a simple one e.g.,
{=1+2}
- Toggle field codes for both fields
- Copy the first field, paste it over the "2" within the second field code
- Update fields
Voilà
Check by editing your custom doc property from with in the properties menu and then do a blanket field update
add a comment |
I got this to work:
- Insert field and add your custom doc property:
{ DOCPROPERTY "Document_Number"}
- Insert a second field as a formula field. Make it a simple one e.g.,
{=1+2}
- Toggle field codes for both fields
- Copy the first field, paste it over the "2" within the second field code
- Update fields
Voilà
Check by editing your custom doc property from with in the properties menu and then do a blanket field update
add a comment |
I got this to work:
- Insert field and add your custom doc property:
{ DOCPROPERTY "Document_Number"}
- Insert a second field as a formula field. Make it a simple one e.g.,
{=1+2}
- Toggle field codes for both fields
- Copy the first field, paste it over the "2" within the second field code
- Update fields
Voilà
Check by editing your custom doc property from with in the properties menu and then do a blanket field update
I got this to work:
- Insert field and add your custom doc property:
{ DOCPROPERTY "Document_Number"}
- Insert a second field as a formula field. Make it a simple one e.g.,
{=1+2}
- Toggle field codes for both fields
- Copy the first field, paste it over the "2" within the second field code
- Update fields
Voilà
Check by editing your custom doc property from with in the properties menu and then do a blanket field update
edited Mar 2 at 4:18
Scott
16.2k113990
16.2k113990
answered Mar 2 at 2:52
user1003651user1003651
1
1
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%2f1110283%2fms-word-using-formulas-with-custom-doc-properties%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
Assumed I could do math calculations on user-defined properties if it was a numeric type. Does anyone know a property I can use to show the number of a document in a series of documents that I can add 1 to?
– Steve G.
Aug 11 '16 at 19:36
If you’re trying to change the document property, the answer that says “You can’t” is right. But if you’re just trying to display the result of a computation involving a document property as a term — your first option (
{ = { DOCPROPERTY "Document_Number" * MERGEFORMAT } +1 }) worked for me (in Word 2013).– Scott
Jul 24 '18 at 4:08