Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Checking to see if a field reference or bookmark exists.
Hello,
We have a word document that we use as a template. Pretty much all the sentences in the document are autonumbered. At the end of the document we have a summary section, as indicated below: [{Autonumber 2.1}]* Some text ..... ..... {Autonumber 3} b Summary /b {Autonumber 3.5} ... as per {2.1} []* Word automatically bookmarks as a hidden bookmark, e.g." _Ref158707320". However, sometimes certain sentences are not required, so we delete them. This results in: {Autonumber 3.5} ... as per {Error! Bookmark not found}. Is there any way to conditionally check for the existence of the bookmark? I'm thinking of something along the lines of: {Autonumber 3.5} ... {if exist{_Ref158707320} then concatenate "as per ", & {_Ref158707320} else "None"} Cheers, Tim |
#2
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Checking to see if a field reference or bookmark exists.
You can always try
{ IF "{ REF _Ref158707320 }" = "Error! Bookmark not found." "None" "as per { REF _Ref158707320 }" } NB, you need the REFs in at least some of these fields - if you just use { _Ref158707320 } you will probably see the error anyway. However, you might also get the message Error! Reference source not found. and if your document happens to be used internationally you might have a different message altogether. So maybe you could put the following at the beginning of your document { SET noref { REF __ } } then use { IF "{ REF _Ref158707320 }" = "{ noref }" "None" "as per { REF _Ref158707320 }" } or if you want to play safe, { IF "{ REF _Ref158707320 }" = "{ REF noref }" "None" "as per { REF _Ref158707320 }" } Peter Jamieson wrote in message ps.com... Hello, We have a word document that we use as a template. Pretty much all the sentences in the document are autonumbered. At the end of the document we have a summary section, as indicated below: [{Autonumber 2.1}]* Some text .... .... {Autonumber 3} b Summary /b {Autonumber 3.5} ... as per {2.1} []* Word automatically bookmarks as a hidden bookmark, e.g." _Ref158707320". However, sometimes certain sentences are not required, so we delete them. This results in: {Autonumber 3.5} ... as per {Error! Bookmark not found}. Is there any way to conditionally check for the existence of the bookmark? I'm thinking of something along the lines of: {Autonumber 3.5} ... {if exist{_Ref158707320} then concatenate "as per ", & {_Ref158707320} else "None"} Cheers, Tim |
#3
|
|||
|
|||
Quote:
Last edited by thosecars82 : March 21st 19 at 02:02 PM |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
cross-reference doesn't show graphic in bookmark | Microsoft Word Help | |||
How does one reference the VALUE of a FORMCHECKBOX bookmark? | Microsoft Word Help | |||
SEQ Field not in cross-reference reference type pull-down menu | Microsoft Word Help | |||
cross reference bookmark | Microsoft Word Help | |||
Reference to Bookmark in header not updating | Microsoft Word Help |