Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / April 2007

Tip: Looking for answers? Try searching our database.

I hate 'Error! Reference source not found'!

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jack G - 27 Apr 2007 02:34 GMT
I use a template for letters which bookmarks a project number that appears
at the top of the letter, and then any subsequent pages have a reference
field pointing to it in their headers.

The problem is that we often delete the project number bookmark on the first
page (intentionally or accidentally) and then the reference field returns
the ugly message, "Error! Reference source not found".  Unfortunately, you
don't even notice until it's printed (or perhaps until after it's been
mailed out)!

I've tried without success to replace the simple reference with something
like =IIf (ProjectBookmark, ProjectBookmark, "")  but I can't seem to get
the syntext right or just plain don't know how to do it.

Has anyone found a solution for this??

Jack
Stefan Blom - 27 Apr 2007 10:21 GMT
You can try the following nested fields (of course, "test" should be
replaced with *your* bookmark name):

{ IF { REF test } = "Error! Reference source not found." "" "{ REF
test }" }

Press Ctrl+F9 to insert each pair of field delimiters, { }. Press F9 to
update. Use Alt+F9 to show/hide field codes.

Note that this assumes that "Error!..." is the exact error message that
is occurring. Of course, if you are sending documents to people using a
different language version of Word, the error message will also be
different, and the code won't work. To get around this, you would have
to get more creative. Peter Jamieson has suggested this approach:

{ SET errmsg { REF NonExistingBookmark } }

{ IF { REF test } = { REF errmsg } "" "{ REF test }" }

Here, "test" should be replaced with your bookmark name, but
NonExistingBookmark should be used (the point is that it should be
non-existing and therefore generate the error message).

For more, see the following thread:

Checking to see if a field reference or bookmark exists
http://groups.google.se/group/microsoft.public.word.docmanagement/browse_thread/
thread/17b44a4a15ef8de4/


Signature

Stefan Blom
Microsoft Word MVP

> I use a template for letters which bookmarks a project number that appears
> at the top of the letter, and then any subsequent pages have a reference
[quoted text clipped - 13 lines]
>
> Jack
Jack G - 27 Apr 2007 17:25 GMT
Thanks, Stefan.  That's much better!  I used the first method, and (after
figuring out that I couldn't just paste your stuff in and that I needed to
use the Ctrl+F9 you talk about) it's working as I had hoped.

> You can try the following nested fields (of course, "test" should be
> replaced with *your* bookmark name):
[quoted text clipped - 48 lines]
>>
>> Jack
Stefan Blom - 30 Apr 2007 07:22 GMT
You are welcome.

As I wrote, the first suggestion assumes that you know the exact error
message, while the second suggestion is the elegant one (and sometimes
the necessary one).

Signature

Stefan Blom
Microsoft Word MVP

> Thanks, Stefan.  That's much better!  I used the first method, and (after
> figuring out that I couldn't just paste your stuff in and that I needed to
[quoted text clipped - 26 lines]
> >
> > Checking to see if a field reference or bookmark exists

http://groups.google.se/group/microsoft.public.word.docmanagement/browse_thread/
thread/17b44a4a15ef8de4/


> >> I use a template for letters which bookmarks a project number that
> > appears
[quoted text clipped - 20 lines]
> >>
> >> Jack

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.