I am trying to set up multiple conditions for filling in a REF Field but am
having trouble getting them all to work.

I have two bookmarks: ReferringPhysician and AttentionLine.

Depending on which bookmarks have information in them, I want to reference
that particular information in the REF fields for the bookmarks. There are
three choices:

1. If AttentionLine has information in the bookmark, I want to use that
variable in the REF field.

2. If AttentionLine is blank and ReferringPhysician is not blank, I want to
use the ReferringPhysician variable in the REF field.

3. If both AttentionLine and ReferringPhysician are blank, I want the REF
field to be blank so that it does not generate an Error! message.

This is the code I came up with for the IF statement, but obviously there is
something wrong with the nesting:

{ IF { REF AttentionLine } <>"" {REF AttentionLine } { IF { REF
AttentionLine } = "" AND { REF ReferringPhysician } <>"" { REF
ReferringPhysician } "" } }

Basically, this is how I want it to look:

Attention: (variable AttentionLine)
Referring Physician: (variable ReferringPhysician)

Dear {REF AttentionLine} or {REF ReferringPhysician} or blank

The "Dear REF" is what I am trying to address here.

Hope this is clear and someone can help.

Thank you!


--
singeredel

Re: Nest If Statements in REF Field by macropod

macropod
Fri Nov 30 14:36:17 PST 2007

Hi singeredel,

Try:
{IF{REF AttentionLine}= "" {IF{REF ReferringPhysician}= "" "" {REF ReferringPhysician}} {REF AttentionLine}}

Cheers
--
macropod
[MVP - Microsoft Word]
-------------------------

"singeredel" <singeredel@discussions.microsoft.com> wrote in message news:F0F36D21-C99D-4EA4-A628-2AF636509761@microsoft.com...
>I am trying to set up multiple conditions for filling in a REF Field but am
> having trouble getting them all to work.
>
> I have two bookmarks: ReferringPhysician and AttentionLine.
>
> Depending on which bookmarks have information in them, I want to reference
> that particular information in the REF fields for the bookmarks. There are
> three choices:
>
> 1. If AttentionLine has information in the bookmark, I want to use that
> variable in the REF field.
>
> 2. If AttentionLine is blank and ReferringPhysician is not blank, I want to
> use the ReferringPhysician variable in the REF field.
>
> 3. If both AttentionLine and ReferringPhysician are blank, I want the REF
> field to be blank so that it does not generate an Error! message.
>
> This is the code I came up with for the IF statement, but obviously there is
> something wrong with the nesting:
>
> { IF { REF AttentionLine } <>"" {REF AttentionLine } { IF { REF
> AttentionLine } = "" AND { REF ReferringPhysician } <>"" { REF
> ReferringPhysician } "" } }
>
> Basically, this is how I want it to look:
>
> Attention: (variable AttentionLine)
> Referring Physician: (variable ReferringPhysician)
>
> Dear {REF AttentionLine} or {REF ReferringPhysician} or blank
>
> The "Dear REF" is what I am trying to address here.
>
> Hope this is clear and someone can help.
>
> Thank you!
>
>
> --
> singeredel

Re: Nest If Statements in REF Field by singeredel

singeredel
Fri Nov 30 15:01:00 PST 2007

Thank you for your help! This appears to work for choices 1 and 3 above, but
does not work for choice 2 and leaves the REF area blank. I am having trouble
following the nesting, as I am not a programmer, so I am unable to figure out
what might need to be changed in the offered code.

thanks...
--
singeredel


"macropod" wrote:

> Hi singeredel,
>
> Try:
> {IF{REF AttentionLine}= "" {IF{REF ReferringPhysician}= "" "" {REF ReferringPhysician}} {REF AttentionLine}}
>
> Cheers
> --
> macropod
> [MVP - Microsoft Word]
> -------------------------
>
> "singeredel" <singeredel@discussions.microsoft.com> wrote in message news:F0F36D21-C99D-4EA4-A628-2AF636509761@microsoft.com...
> >I am trying to set up multiple conditions for filling in a REF Field but am
> > having trouble getting them all to work.
> >
> > I have two bookmarks: ReferringPhysician and AttentionLine.
> >
> > Depending on which bookmarks have information in them, I want to reference
> > that particular information in the REF fields for the bookmarks. There are
> > three choices:
> >
> > 1. If AttentionLine has information in the bookmark, I want to use that
> > variable in the REF field.
> >
> > 2. If AttentionLine is blank and ReferringPhysician is not blank, I want to
> > use the ReferringPhysician variable in the REF field.
> >
> > 3. If both AttentionLine and ReferringPhysician are blank, I want the REF
> > field to be blank so that it does not generate an Error! message.
> >
> > This is the code I came up with for the IF statement, but obviously there is
> > something wrong with the nesting:
> >
> > { IF { REF AttentionLine } <>"" {REF AttentionLine } { IF { REF
> > AttentionLine } = "" AND { REF ReferringPhysician } <>"" { REF
> > ReferringPhysician } "" } }
> >
> > Basically, this is how I want it to look:
> >
> > Attention: (variable AttentionLine)
> > Referring Physician: (variable ReferringPhysician)
> >
> > Dear {REF AttentionLine} or {REF ReferringPhysician} or blank
> >
> > The "Dear REF" is what I am trying to address here.
> >
> > Hope this is clear and someone can help.
> >
> > Thank you!
> >
> >
> > --
> > singeredel
>

Re: Nest If Statements in REF Field by Doug

Doug
Fri Nov 30 22:31:35 PST 2007

Are you sure that the name of the physician is actually inside the bookmark
ReferringPhysician?

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"singeredel" <singeredel@discussions.microsoft.com> wrote in message
news:634E47AD-7F89-40A6-8A29-4800B86E60BB@microsoft.com...
> Thank you for your help! This appears to work for choices 1 and 3 above,
> but
> does not work for choice 2 and leaves the REF area blank. I am having
> trouble
> following the nesting, as I am not a programmer, so I am unable to figure
> out
> what might need to be changed in the offered code.
>
> thanks...
> --
> singeredel
>
>
> "macropod" wrote:
>
>> Hi singeredel,
>>
>> Try:
>> {IF{REF AttentionLine}= "" {IF{REF ReferringPhysician}= "" "" {REF
>> ReferringPhysician}} {REF AttentionLine}}
>>
>> Cheers
>> --
>> macropod
>> [MVP - Microsoft Word]
>> -------------------------
>>
>> "singeredel" <singeredel@discussions.microsoft.com> wrote in message
>> news:F0F36D21-C99D-4EA4-A628-2AF636509761@microsoft.com...
>> >I am trying to set up multiple conditions for filling in a REF Field but
>> >am
>> > having trouble getting them all to work.
>> >
>> > I have two bookmarks: ReferringPhysician and AttentionLine.
>> >
>> > Depending on which bookmarks have information in them, I want to
>> > reference
>> > that particular information in the REF fields for the bookmarks. There
>> > are
>> > three choices:
>> >
>> > 1. If AttentionLine has information in the bookmark, I want to use
>> > that
>> > variable in the REF field.
>> >
>> > 2. If AttentionLine is blank and ReferringPhysician is not blank, I
>> > want to
>> > use the ReferringPhysician variable in the REF field.
>> >
>> > 3. If both AttentionLine and ReferringPhysician are blank, I want the
>> > REF
>> > field to be blank so that it does not generate an Error! message.
>> >
>> > This is the code I came up with for the IF statement, but obviously
>> > there is
>> > something wrong with the nesting:
>> >
>> > { IF { REF AttentionLine } <>"" {REF AttentionLine } { IF { REF
>> > AttentionLine } = "" AND { REF ReferringPhysician } <>"" { REF
>> > ReferringPhysician } "" } }
>> >
>> > Basically, this is how I want it to look:
>> >
>> > Attention: (variable AttentionLine)
>> > Referring Physician: (variable ReferringPhysician)
>> >
>> > Dear {REF AttentionLine} or {REF ReferringPhysician} or blank
>> >
>> > The "Dear REF" is what I am trying to address here.
>> >
>> > Hope this is clear and someone can help.
>> >
>> > Thank you!
>> >
>> >
>> > --
>> > singeredel
>>



Re: Nest If Statements in REF Field by macropod

macropod
Fri Nov 30 23:18:06 PST 2007

Hi singeredel,

Make sure your field code spacing is exactly as posted - anything less *won't* work and, depending on where you insert any
extraneous spaces, anything more *may* fail also.

Cheers
--
macropod
[MVP - Microsoft Word]
-------------------------

"singeredel" <singeredel@discussions.microsoft.com> wrote in message news:634E47AD-7F89-40A6-8A29-4800B86E60BB@microsoft.com...
> Thank you for your help! This appears to work for choices 1 and 3 above, but
> does not work for choice 2 and leaves the REF area blank. I am having trouble
> following the nesting, as I am not a programmer, so I am unable to figure out
> what might need to be changed in the offered code.
>
> thanks...
> --
> singeredel
>
>
> "macropod" wrote:
>
>> Hi singeredel,
>>
>> Try:
>> {IF{REF AttentionLine}= "" {IF{REF ReferringPhysician}= "" "" {REF ReferringPhysician}} {REF AttentionLine}}
>>
>> Cheers
>> --
>> macropod
>> [MVP - Microsoft Word]
>> -------------------------
>>
>> "singeredel" <singeredel@discussions.microsoft.com> wrote in message news:F0F36D21-C99D-4EA4-A628-2AF636509761@microsoft.com...
>> >I am trying to set up multiple conditions for filling in a REF Field but am
>> > having trouble getting them all to work.
>> >
>> > I have two bookmarks: ReferringPhysician and AttentionLine.
>> >
>> > Depending on which bookmarks have information in them, I want to reference
>> > that particular information in the REF fields for the bookmarks. There are
>> > three choices:
>> >
>> > 1. If AttentionLine has information in the bookmark, I want to use that
>> > variable in the REF field.
>> >
>> > 2. If AttentionLine is blank and ReferringPhysician is not blank, I want to
>> > use the ReferringPhysician variable in the REF field.
>> >
>> > 3. If both AttentionLine and ReferringPhysician are blank, I want the REF
>> > field to be blank so that it does not generate an Error! message.
>> >
>> > This is the code I came up with for the IF statement, but obviously there is
>> > something wrong with the nesting:
>> >
>> > { IF { REF AttentionLine } <>"" {REF AttentionLine } { IF { REF
>> > AttentionLine } = "" AND { REF ReferringPhysician } <>"" { REF
>> > ReferringPhysician } "" } }
>> >
>> > Basically, this is how I want it to look:
>> >
>> > Attention: (variable AttentionLine)
>> > Referring Physician: (variable ReferringPhysician)
>> >
>> > Dear {REF AttentionLine} or {REF ReferringPhysician} or blank
>> >
>> > The "Dear REF" is what I am trying to address here.
>> >
>> > Hope this is clear and someone can help.
>> >
>> > Thank you!
>> >
>> >
>> > --
>> > singeredel
>>


Re: Nest If Statements in REF Field by singeredel

singeredel
Sat Dec 01 08:46:00 PST 2007

Yes, the bookmarks have data when applicable for checking the IF conditions.
--
singeredel


"Doug Robbins - Word MVP" wrote:

> Are you sure that the name of the physician is actually inside the bookmark
> ReferringPhysician?
>
> --
> Hope this helps.
>
> Please reply to the newsgroup unless you wish to avail yourself of my
> services on a paid consulting basis.
>
> Doug Robbins - Word MVP
>
> "singeredel" <singeredel@discussions.microsoft.com> wrote in message
> news:634E47AD-7F89-40A6-8A29-4800B86E60BB@microsoft.com...
> > Thank you for your help! This appears to work for choices 1 and 3 above,
> > but
> > does not work for choice 2 and leaves the REF area blank. I am having
> > trouble
> > following the nesting, as I am not a programmer, so I am unable to figure
> > out
> > what might need to be changed in the offered code.
> >
> > thanks...
> > --
> > singeredel
> >
> >
> > "macropod" wrote:
> >
> >> Hi singeredel,
> >>
> >> Try:
> >> {IF{REF AttentionLine}= "" {IF{REF ReferringPhysician}= "" "" {REF
> >> ReferringPhysician}} {REF AttentionLine}}
> >>
> >> Cheers
> >> --
> >> macropod
> >> [MVP - Microsoft Word]
> >> -------------------------
> >>
> >> "singeredel" <singeredel@discussions.microsoft.com> wrote in message
> >> news:F0F36D21-C99D-4EA4-A628-2AF636509761@microsoft.com...
> >> >I am trying to set up multiple conditions for filling in a REF Field but
> >> >am
> >> > having trouble getting them all to work.
> >> >
> >> > I have two bookmarks: ReferringPhysician and AttentionLine.
> >> >
> >> > Depending on which bookmarks have information in them, I want to
> >> > reference
> >> > that particular information in the REF fields for the bookmarks. There
> >> > are
> >> > three choices:
> >> >
> >> > 1. If AttentionLine has information in the bookmark, I want to use
> >> > that
> >> > variable in the REF field.
> >> >
> >> > 2. If AttentionLine is blank and ReferringPhysician is not blank, I
> >> > want to
> >> > use the ReferringPhysician variable in the REF field.
> >> >
> >> > 3. If both AttentionLine and ReferringPhysician are blank, I want the
> >> > REF
> >> > field to be blank so that it does not generate an Error! message.
> >> >
> >> > This is the code I came up with for the IF statement, but obviously
> >> > there is
> >> > something wrong with the nesting:
> >> >
> >> > { IF { REF AttentionLine } <>"" {REF AttentionLine } { IF { REF
> >> > AttentionLine } = "" AND { REF ReferringPhysician } <>"" { REF
> >> > ReferringPhysician } "" } }
> >> >
> >> > Basically, this is how I want it to look:
> >> >
> >> > Attention: (variable AttentionLine)
> >> > Referring Physician: (variable ReferringPhysician)
> >> >
> >> > Dear {REF AttentionLine} or {REF ReferringPhysician} or blank
> >> >
> >> > The "Dear REF" is what I am trying to address here.
> >> >
> >> > Hope this is clear and someone can help.
> >> >
> >> > Thank you!
> >> >
> >> >
> >> > --
> >> > singeredel
> >>
>
>
>

Re: Nest If Statements in REF Field by singeredel

singeredel
Sat Dec 01 08:49:00 PST 2007

The field code spacing was tried exactly as you have listed, but the one
condition does not appear to work (the IF and AND statement does not work --
i.e. if AttentionLine is blank and ReferringPhysician is not blank, then use
ReferringPhysician).
--
singeredel


"macropod" wrote:

> Hi singeredel,
>
> Make sure your field code spacing is exactly as posted - anything less *won't* work and, depending on where you insert any
> extraneous spaces, anything more *may* fail also.
>
> Cheers
> --
> macropod
> [MVP - Microsoft Word]
> -------------------------
>
> "singeredel" <singeredel@discussions.microsoft.com> wrote in message news:634E47AD-7F89-40A6-8A29-4800B86E60BB@microsoft.com...
> > Thank you for your help! This appears to work for choices 1 and 3 above, but
> > does not work for choice 2 and leaves the REF area blank. I am having trouble
> > following the nesting, as I am not a programmer, so I am unable to figure out
> > what might need to be changed in the offered code.
> >
> > thanks...
> > --
> > singeredel
> >
> >
> > "macropod" wrote:
> >
> >> Hi singeredel,
> >>
> >> Try:
> >> {IF{REF AttentionLine}= "" {IF{REF ReferringPhysician}= "" "" {REF ReferringPhysician}} {REF AttentionLine}}
> >>
> >> Cheers
> >> --
> >> macropod
> >> [MVP - Microsoft Word]
> >> -------------------------
> >>
> >> "singeredel" <singeredel@discussions.microsoft.com> wrote in message news:F0F36D21-C99D-4EA4-A628-2AF636509761@microsoft.com...
> >> >I am trying to set up multiple conditions for filling in a REF Field but am
> >> > having trouble getting them all to work.
> >> >
> >> > I have two bookmarks: ReferringPhysician and AttentionLine.
> >> >
> >> > Depending on which bookmarks have information in them, I want to reference
> >> > that particular information in the REF fields for the bookmarks. There are
> >> > three choices:
> >> >
> >> > 1. If AttentionLine has information in the bookmark, I want to use that
> >> > variable in the REF field.
> >> >
> >> > 2. If AttentionLine is blank and ReferringPhysician is not blank, I want to
> >> > use the ReferringPhysician variable in the REF field.
> >> >
> >> > 3. If both AttentionLine and ReferringPhysician are blank, I want the REF
> >> > field to be blank so that it does not generate an Error! message.
> >> >
> >> > This is the code I came up with for the IF statement, but obviously there is
> >> > something wrong with the nesting:
> >> >
> >> > { IF { REF AttentionLine } <>"" {REF AttentionLine } { IF { REF
> >> > AttentionLine } = "" AND { REF ReferringPhysician } <>"" { REF
> >> > ReferringPhysician } "" } }
> >> >
> >> > Basically, this is how I want it to look:
> >> >
> >> > Attention: (variable AttentionLine)
> >> > Referring Physician: (variable ReferringPhysician)
> >> >
> >> > Dear {REF AttentionLine} or {REF ReferringPhysician} or blank
> >> >
> >> > The "Dear REF" is what I am trying to address here.
> >> >
> >> > Hope this is clear and someone can help.
> >> >
> >> > Thank you!
> >> >
> >> >
> >> > --
> >> > singeredel
> >>
>
>

Re: Nest If Statements in REF Field by Doug

Doug
Sat Dec 01 11:48:15 PST 2007

What does just {REF ReferringPhysician}display?

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"singeredel" <singeredel@discussions.microsoft.com> wrote in message
news:99E68B45-12BD-4A49-A039-74E58F2B7A83@microsoft.com...
> Yes, the bookmarks have data when applicable for checking the IF
> conditions.
> --
> singeredel
>
>
> "Doug Robbins - Word MVP" wrote:
>
>> Are you sure that the name of the physician is actually inside the
>> bookmark
>> ReferringPhysician?
>>
>> --
>> Hope this helps.
>>
>> Please reply to the newsgroup unless you wish to avail yourself of my
>> services on a paid consulting basis.
>>
>> Doug Robbins - Word MVP
>>
>> "singeredel" <singeredel@discussions.microsoft.com> wrote in message
>> news:634E47AD-7F89-40A6-8A29-4800B86E60BB@microsoft.com...
>> > Thank you for your help! This appears to work for choices 1 and 3
>> > above,
>> > but
>> > does not work for choice 2 and leaves the REF area blank. I am having
>> > trouble
>> > following the nesting, as I am not a programmer, so I am unable to
>> > figure
>> > out
>> > what might need to be changed in the offered code.
>> >
>> > thanks...
>> > --
>> > singeredel
>> >
>> >
>> > "macropod" wrote:
>> >
>> >> Hi singeredel,
>> >>
>> >> Try:
>> >> {IF{REF AttentionLine}= "" {IF{REF ReferringPhysician}= "" "" {REF
>> >> ReferringPhysician}} {REF AttentionLine}}
>> >>
>> >> Cheers
>> >> --
>> >> macropod
>> >> [MVP - Microsoft Word]
>> >> -------------------------
>> >>
>> >> "singeredel" <singeredel@discussions.microsoft.com> wrote in message
>> >> news:F0F36D21-C99D-4EA4-A628-2AF636509761@microsoft.com...
>> >> >I am trying to set up multiple conditions for filling in a REF Field
>> >> >but
>> >> >am
>> >> > having trouble getting them all to work.
>> >> >
>> >> > I have two bookmarks: ReferringPhysician and AttentionLine.
>> >> >
>> >> > Depending on which bookmarks have information in them, I want to
>> >> > reference
>> >> > that particular information in the REF fields for the bookmarks.
>> >> > There
>> >> > are
>> >> > three choices:
>> >> >
>> >> > 1. If AttentionLine has information in the bookmark, I want to use
>> >> > that
>> >> > variable in the REF field.
>> >> >
>> >> > 2. If AttentionLine is blank and ReferringPhysician is not blank, I
>> >> > want to
>> >> > use the ReferringPhysician variable in the REF field.
>> >> >
>> >> > 3. If both AttentionLine and ReferringPhysician are blank, I want
>> >> > the
>> >> > REF
>> >> > field to be blank so that it does not generate an Error! message.
>> >> >
>> >> > This is the code I came up with for the IF statement, but obviously
>> >> > there is
>> >> > something wrong with the nesting:
>> >> >
>> >> > { IF { REF AttentionLine } <>"" {REF AttentionLine } { IF { REF
>> >> > AttentionLine } = "" AND { REF ReferringPhysician } <>"" { REF
>> >> > ReferringPhysician } "" } }
>> >> >
>> >> > Basically, this is how I want it to look:
>> >> >
>> >> > Attention: (variable AttentionLine)
>> >> > Referring Physician: (variable ReferringPhysician)
>> >> >
>> >> > Dear {REF AttentionLine} or {REF ReferringPhysician} or blank
>> >> >
>> >> > The "Dear REF" is what I am trying to address here.
>> >> >
>> >> > Hope this is clear and someone can help.
>> >> >
>> >> > Thank you!
>> >> >
>> >> >
>> >> > --
>> >> > singeredel
>> >>
>>
>>
>>



RE: Nest If Statements in REF Field by singeredel

singeredel
Sat Dec 01 12:13:01 PST 2007

I found my error. I left a space in the bookmark when testing so I wouldn't
lose the bookmark, so the space prevented the bookmark from being empty or
"".
--
singeredel


"singeredel" wrote:

> I am trying to set up multiple conditions for filling in a REF Field but am
> having trouble getting them all to work.
>
> I have two bookmarks: ReferringPhysician and AttentionLine.
>
> Depending on which bookmarks have information in them, I want to reference
> that particular information in the REF fields for the bookmarks. There are
> three choices:
>
> 1. If AttentionLine has information in the bookmark, I want to use that
> variable in the REF field.
>
> 2. If AttentionLine is blank and ReferringPhysician is not blank, I want to
> use the ReferringPhysician variable in the REF field.
>
> 3. If both AttentionLine and ReferringPhysician are blank, I want the REF
> field to be blank so that it does not generate an Error! message.
>
> This is the code I came up with for the IF statement, but obviously there is
> something wrong with the nesting:
>
> { IF { REF AttentionLine } <>"" {REF AttentionLine } { IF { REF
> AttentionLine } = "" AND { REF ReferringPhysician } <>"" { REF
> ReferringPhysician } "" } }
>
> Basically, this is how I want it to look:
>
> Attention: (variable AttentionLine)
> Referring Physician: (variable ReferringPhysician)
>
> Dear {REF AttentionLine} or {REF ReferringPhysician} or blank
>
> The "Dear REF" is what I am trying to address here.
>
> Hope this is clear and someone can help.
>
> Thank you!
>
>
> --
> singeredel

RE: Nest If Statements in REF Field by singeredel

singeredel
Mon Dec 03 14:39:04 PST 2007

Hi again. I need to modify this further to include an IF condition for the
bookmark not being found. The prior nested code works fine until I have to
delete the area in the document where the bookmark turns out to be empty.
When I delete the bookmarked area, it then pops an Error! message that the
reference source is not found. For example, even if the Dear {REF
ReferringPhysician} puts in the name, when I delete the empty text for
AttentionLine that includes the bookmark, I then get an error showing.

i.e., I need it to do nothing and not pop and error if the referenced
bookmark does not exist, so that when I delete the empty line of text that
contains the bookmark, there is not an error.

Attention: (empty variable) -- this bookmark has no information and the
line eventually gets deleted because it is blank.

Referring Physician: Dr. A (variable) -- this bookmark has information
which shows in the REF next to "Dear "

Dear Dr. A: (this becomes an error once the AttentionLine bookmark gets
deleted.

Hope this is clear.

thanks!

--
singeredel


"singeredel" wrote:

> I am trying to set up multiple conditions for filling in a REF Field but am
> having trouble getting them all to work.
>
> I have two bookmarks: ReferringPhysician and AttentionLine.
>
> Depending on which bookmarks have information in them, I want to reference
> that particular information in the REF fields for the bookmarks. There are
> three choices:
>
> 1. If AttentionLine has information in the bookmark, I want to use that
> variable in the REF field.
>
> 2. If AttentionLine is blank and ReferringPhysician is not blank, I want to
> use the ReferringPhysician variable in the REF field.
>
> 3. If both AttentionLine and ReferringPhysician are blank, I want the REF
> field to be blank so that it does not generate an Error! message.
>
> This is the code I came up with for the IF statement, but obviously there is
> something wrong with the nesting:
>
> { IF { REF AttentionLine } <>"" {REF AttentionLine } { IF { REF
> AttentionLine } = "" AND { REF ReferringPhysician } <>"" { REF
> ReferringPhysician } "" } }
>
> Basically, this is how I want it to look:
>
> Attention: (variable AttentionLine)
> Referring Physician: (variable ReferringPhysician)
>
> Dear {REF AttentionLine} or {REF ReferringPhysician} or blank
>
> The "Dear REF" is what I am trying to address here.
>
> Hope this is clear and someone can help.
>
> Thank you!
>
>
> --
> singeredel

Re: Nest If Statements in REF Field by macropod

macropod
Mon Dec 03 22:37:52 PST 2007

Hi singeredel,

The following will suppress the error message in the absence of either or both bookmarks:
{IF{REF AttentionLine}= "Error*" "" {IF{REF AttentionLine}= "" {IF{REF ReferringPhysician}= "Error*" "" {IF{REF ReferringPhysician}=
"" "" {REF ReferringPhysician}}} {REF AttentionLine}}}

Cheers
--
macropod
[MVP - Microsoft Word]
-------------------------
PS: None of this is vba.

"singeredel" <singeredel@discussions.microsoft.com> wrote in message news:DF7FD28B-5BD3-4B84-810D-FEAD3C0AA2D4@microsoft.com...
> Hi again. I need to modify this further to include an IF condition for the
> bookmark not being found. The prior nested code works fine until I have to
> delete the area in the document where the bookmark turns out to be empty.
> When I delete the bookmarked area, it then pops an Error! message that the
> reference source is not found. For example, even if the Dear {REF
> ReferringPhysician} puts in the name, when I delete the empty text for
> AttentionLine that includes the bookmark, I then get an error showing.
>
> i.e., I need it to do nothing and not pop and error if the referenced
> bookmark does not exist, so that when I delete the empty line of text that
> contains the bookmark, there is not an error.
>
> Attention: (empty variable) -- this bookmark has no information and the
> line eventually gets deleted because it is blank.
>
> Referring Physician: Dr. A (variable) -- this bookmark has information
> which shows in the REF next to "Dear "
>
> Dear Dr. A: (this becomes an error once the AttentionLine bookmark gets
> deleted.
>
> Hope this is clear.
>
> thanks!
>
> --
> singeredel
>
>
> "singeredel" wrote:
>
>> I am trying to set up multiple conditions for filling in a REF Field but am
>> having trouble getting them all to work.
>>
>> I have two bookmarks: ReferringPhysician and AttentionLine.
>>
>> Depending on which bookmarks have information in them, I want to reference
>> that particular information in the REF fields for the bookmarks. There are
>> three choices:
>>
>> 1. If AttentionLine has information in the bookmark, I want to use that
>> variable in the REF field.
>>
>> 2. If AttentionLine is blank and ReferringPhysician is not blank, I want to
>> use the ReferringPhysician variable in the REF field.
>>
>> 3. If both AttentionLine and ReferringPhysician are blank, I want the REF
>> field to be blank so that it does not generate an Error! message.
>>
>> This is the code I came up with for the IF statement, but obviously there is
>> something wrong with the nesting:
>>
>> { IF { REF AttentionLine } <>"" {REF AttentionLine } { IF { REF
>> AttentionLine } = "" AND { REF ReferringPhysician } <>"" { REF
>> ReferringPhysician } "" } }
>>
>> Basically, this is how I want it to look:
>>
>> Attention: (variable AttentionLine)
>> Referring Physician: (variable ReferringPhysician)
>>
>> Dear {REF AttentionLine} or {REF ReferringPhysician} or blank
>>
>> The "Dear REF" is what I am trying to address here.
>>
>> Hope this is clear and someone can help.
>>
>> Thank you!
>>
>>
>> --
>> singeredel


Re: Nest If Statements in REF Field by singeredel

singeredel
Tue Dec 04 13:46:07 PST 2007

What is happening with this suggestion is that when the empty bookmark
AttentionLine is deleted, the end result leaves the "Dear REF field" blank
even if there is a variable in the bookmark ReferringPhysician, whereas it
should only be blank if both AttentionLine and ReferringPhysician are
missing.

The sequence should be to use the variable in AttentionLine first. If that
is blank, then use the Referring Physician variable. If both are blank, leave
Dear "REF Field" blank and don't don't pop an error when bookmarks are
deleted.

I don't know if this is possible or not.

Thanks so much for your help!
--
singeredel


"macropod" wrote:

> Hi singeredel,
>
> The following will suppress the error message in the absence of either or both bookmarks:
> {IF{REF AttentionLine}= "Error*" "" {IF{REF AttentionLine}= "" {IF{REF ReferringPhysician}= "Error*" "" {IF{REF ReferringPhysician}=
> "" "" {REF ReferringPhysician}}} {REF AttentionLine}}}
>
> Cheers
> --
> macropod
> [MVP - Microsoft Word]
> -------------------------
> PS: None of this is vba.
>
> "singeredel" <singeredel@discussions.microsoft.com> wrote in message news:DF7FD28B-5BD3-4B84-810D-FEAD3C0AA2D4@microsoft.com...
> > Hi again. I need to modify this further to include an IF condition for the
> > bookmark not being found. The prior nested code works fine until I have to
> > delete the area in the document where the bookmark turns out to be empty.
> > When I delete the bookmarked area, it then pops an Error! message that the
> > reference source is not found. For example, even if the Dear {REF
> > ReferringPhysician} puts in the name, when I delete the empty text for
> > AttentionLine that includes the bookmark, I then get an error showing.
> >
> > i.e., I need it to do nothing and not pop and error if the referenced
> > bookmark does not exist, so that when I delete the empty line of text that
> > contains the bookmark, there is not an error.
> >
> > Attention: (empty variable) -- this bookmark has no information and the
> > line eventually gets deleted because it is blank.
> >
> > Referring Physician: Dr. A (variable) -- this bookmark has information
> > which shows in the REF next to "Dear "
> >
> > Dear Dr. A: (this becomes an error once the AttentionLine bookmark gets
> > deleted.
> >
> > Hope this is clear.
> >
> > thanks!
> >
> > --
> > singeredel
> >
> >
> > "singeredel" wrote:
> >
> >> I am trying to set up multiple conditions for filling in a REF Field but am
> >> having trouble getting them all to work.
> >>
> >> I have two bookmarks: ReferringPhysician and AttentionLine.
> >>
> >> Depending on which bookmarks have information in them, I want to reference
> >> that particular information in the REF fields for the bookmarks. There are
> >> three choices:
> >>
> >> 1. If AttentionLine has information in the bookmark, I want to use that
> >> variable in the REF field.
> >>
> >> 2. If AttentionLine is blank and ReferringPhysician is not blank, I want to
> >> use the ReferringPhysician variable in the REF field.
> >>
> >> 3. If both AttentionLine and ReferringPhysician are blank, I want the REF
> >> field to be blank so that it does not generate an Error! message.
> >>
> >> This is the code I came up with for the IF statement, but obviously there is
> >> something wrong with the nesting:
> >>
> >> { IF { REF AttentionLine } <>"" {REF AttentionLine } { IF { REF
> >> AttentionLine } = "" AND { REF ReferringPhysician } <>"" { REF
> >> ReferringPhysician } "" } }
> >>
> >> Basically, this is how I want it to look:
> >>
> >> Attention: (variable AttentionLine)
> >> Referring Physician: (variable ReferringPhysician)
> >>
> >> Dear {REF AttentionLine} or {REF ReferringPhysician} or blank
> >>
> >> The "Dear REF" is what I am trying to address here.
> >>
> >> Hope this is clear and someone can help.
> >>
> >> Thank you!
> >>
> >>
> >> --
> >> singeredel
>
>

Re: Nest If Statements in REF Field by macropod

macropod
Tue Dec 04 14:08:19 PST 2007

Hi singeredel,

OK, try this construction:
{IF{={IF{REF AttentionLine}= "Error*" 1 0}+{IF{REF AttentionLine}= "" 1 0}}> 0 {IF{={IF{REF ReferringPhysician}= "Error*" 1
0}+{IF{REF ReferringPhysician}= "" 1 0}}> 0 "" {REF ReferringPhysician}} {REF AttentionLine}}

Cheers
--
macropod
[MVP - Microsoft Word]
-------------------------

"singeredel" <singeredel@discussions.microsoft.com> wrote in message news:AD30CC8A-5C22-4D7B-81E4-7D54FD8DA564@microsoft.com...
> What is happening with this suggestion is that when the empty bookmark
> AttentionLine is deleted, the end result leaves the "Dear REF field" blank
> even if there is a variable in the bookmark ReferringPhysician, whereas it
> should only be blank if both AttentionLine and ReferringPhysician are
> missing.
>
> The sequence should be to use the variable in AttentionLine first. If that
> is blank, then use the Referring Physician variable. If both are blank, leave
> Dear "REF Field" blank and don't don't pop an error when bookmarks are
> deleted.
>
> I don't know if this is possible or not.
>
> Thanks so much for your help!
> --
> singeredel
>
>
> "macropod" wrote:
>
>> Hi singeredel,
>>
>> The following will suppress the error message in the absence of either or both bookmarks:
>> {IF{REF AttentionLine}= "Error*" "" {IF{REF AttentionLine}= "" {IF{REF ReferringPhysician}= "Error*" "" {IF{REF
>> ReferringPhysician}=
>> "" "" {REF ReferringPhysician}}} {REF AttentionLine}}}
>>
>> Cheers
>> --
>> macropod
>> [MVP - Microsoft Word]
>> -------------------------
>> PS: None of this is vba.
>>
>> "singeredel" <singeredel@discussions.microsoft.com> wrote in message news:DF7FD28B-5BD3-4B84-810D-FEAD3C0AA2D4@microsoft.com...
>> > Hi again. I need to modify this further to include an IF condition for the
>> > bookmark not being found. The prior nested code works fine until I have to
>> > delete the area in the document where the bookmark turns out to be empty.
>> > When I delete the bookmarked area, it then pops an Error! message that the
>> > reference source is not found. For example, even if the Dear {REF
>> > ReferringPhysician} puts in the name, when I delete the empty text for
>> > AttentionLine that includes the bookmark, I then get an error showing.
>> >
>> > i.e., I need it to do nothing and not pop and error if the referenced
>> > bookmark does not exist, so that when I delete the empty line of text that
>> > contains the bookmark, there is not an error.
>> >
>> > Attention: (empty variable) -- this bookmark has no information and the
>> > line eventually gets deleted because it is blank.
>> >
>> > Referring Physician: Dr. A (variable) -- this bookmark has information
>> > which shows in the REF next to "Dear "
>> >
>> > Dear Dr. A: (this becomes an error once the AttentionLine bookmark gets
>> > deleted.
>> >
>> > Hope this is clear.
>> >
>> > thanks!
>> >
>> > --
>> > singeredel
>> >
>> >
>> > "singeredel" wrote:
>> >
>> >> I am trying to set up multiple conditions for filling in a REF Field but am
>> >> having trouble getting them all to work.
>> >>
>> >> I have two bookmarks: ReferringPhysician and AttentionLine.
>> >>
>> >> Depending on which bookmarks have information in them, I want to reference
>> >> that particular information in the REF fields for the bookmarks. There are
>> >> three choices:
>> >>
>> >> 1. If AttentionLine has information in the bookmark, I want to use that
>> >> variable in the REF field.
>> >>
>> >> 2. If AttentionLine is blank and ReferringPhysician is not blank, I want to
>> >> use the ReferringPhysician variable in the REF field.
>> >>
>> >> 3. If both AttentionLine and ReferringPhysician are blank, I want the REF
>> >> field to be blank so that it does not generate an Error! message.
>> >>
>> >> This is the code I came up with for the IF statement, but obviously there is
>> >> something wrong with the nesting:
>> >>
>> >> { IF { REF AttentionLine } <>"" {REF AttentionLine } { IF { REF
>> >> AttentionLine } = "" AND { REF ReferringPhysician } <>"" { REF
>> >> ReferringPhysician } "" } }
>> >>
>> >> Basically, this is how I want it to look:
>> >>
>> >> Attention: (variable AttentionLine)
>> >> Referring Physician: (variable ReferringPhysician)
>> >>
>> >> Dear {REF AttentionLine} or {REF ReferringPhysician} or blank
>> >>
>> >> The "Dear REF" is what I am trying to address here.
>> >>
>> >> Hope this is clear and someone can help.
>> >>
>> >> Thank you!
>> >>
>> >>
>> >> --
>> >> singeredel
>>
>>


Re: Nest If Statements in REF Field by singeredel

singeredel
Tue Dec 04 21:06:02 PST 2007

Yes! This works! Thank you so much! Unfortunately, I cannot figure out how to
read this so that I can understand the process and apply it to other
applications, but it does work...
--
singeredel


"macropod" wrote:

> Hi singeredel,
>
> OK, try this construction:
> {IF{={IF{REF AttentionLine}= "Error*" 1 0}+{IF{REF AttentionLine}= "" 1 0}}> 0 {IF{={IF{REF ReferringPhysician}= "Error*" 1
> 0}+{IF{REF ReferringPhysician}= "" 1 0}}> 0 "" {REF ReferringPhysician}} {REF AttentionLine}}
>
> Cheers
> --
> macropod
> [MVP - Microsoft Word]
> -------------------------
>
> "singeredel" <singeredel@discussions.microsoft.com> wrote in message news:AD30CC8A-5C22-4D7B-81E4-7D54FD8DA564@microsoft.com...
> > What is happening with this suggestion is that when the empty bookmark
> > AttentionLine is deleted, the end result leaves the "Dear REF field" blank
> > even if there is a variable in the bookmark ReferringPhysician, whereas it
> > should only be blank if both AttentionLine and ReferringPhysician are
> > missing.
> >
> > The sequence should be to use the variable in AttentionLine first. If that
> > is blank, then use the Referring Physician variable. If both are blank, leave
> > Dear "REF Field" blank and don't don't pop an error when bookmarks are
> > deleted.
> >
> > I don't know if this is possible or not.
> >
> > Thanks so much for your help!
> > --
> > singeredel
> >
> >
> > "macropod" wrote:
> >
> >> Hi singeredel,
> >>
> >> The following will suppress the error message in the absence of either or both bookmarks:
> >> {IF{REF AttentionLine}= "Error*" "" {IF{REF AttentionLine}= "" {IF{REF ReferringPhysician}= "Error*" "" {IF{REF
> >> ReferringPhysician}=
> >> "" "" {REF ReferringPhysician}}} {REF AttentionLine}}}
> >>
> >> Cheers
> >> --
> >> macropod
> >> [MVP - Microsoft Word]
> >> -------------------------
> >> PS: None of this is vba.
> >>
> >> "singeredel" <singeredel@discussions.microsoft.com> wrote in message news:DF7FD28B-5BD3-4B84-810D-FEAD3C0AA2D4@microsoft.com...
> >> > Hi again. I need to modify this further to include an IF condition for the
> >> > bookmark not being found. The prior nested code works fine until I have to
> >> > delete the area in the document where the bookmark turns out to be empty.
> >> > When I delete the bookmarked area, it then pops an Error! message that the
> >> > reference source is not found. For example, even if the Dear {REF
> >> > ReferringPhysician} puts in the name, when I delete the empty text for
> >> > AttentionLine that includes the bookmark, I then get an error showing.
> >> >
> >> > i.e., I need it to do nothing and not pop and error if the referenced
> >> > bookmark does not exist, so that when I delete the empty line of text that
> >> > contains the bookmark, there is not an error.
> >> >
> >> > Attention: (empty variable) -- this bookmark has no information and the
> >> > line eventually gets deleted because it is blank.
> >> >
> >> > Referring Physician: Dr. A (variable) -- this bookmark has information
> >> > which shows in the REF next to "Dear "
> >> >
> >> > Dear Dr. A: (this becomes an error once the AttentionLine bookmark gets
> >> > deleted.
> >> >
> >> > Hope this is clear.
> >> >
> >> > thanks!
> >> >
> >> > --
> >> > singeredel
> >> >
> >> >
> >> > "singeredel" wrote:
> >> >
> >> >> I am trying to set up multiple conditions for filling in a REF Field but am
> >> >> having trouble getting them all to work.
> >> >>
> >> >> I have two bookmarks: ReferringPhysician and AttentionLine.
> >> >>
> >> >> Depending on which bookmarks have information in them, I want to reference
> >> >> that particular information in the REF fields for the bookmarks. There are
> >> >> three choices:
> >> >>
> >> >> 1. If AttentionLine has information in the bookmark, I want to use that
> >> >> variable in the REF field.
> >> >>
> >> >> 2. If AttentionLine is blank and ReferringPhysician is not blank, I want to
> >> >> use the ReferringPhysician variable in the REF field.
> >> >>
> >> >> 3. If both AttentionLine and ReferringPhysician are blank, I want the REF
> >> >> field to be blank so that it does not generate an Error! message.
> >> >>
> >> >> This is the code I came up with for the IF statement, but obviously there is
> >> >> something wrong with the nesting:
> >> >>
> >> >> { IF { REF AttentionLine } <>"" {REF AttentionLine } { IF { REF
> >> >> AttentionLine } = "" AND { REF ReferringPhysician } <>"" { REF
> >> >> ReferringPhysician } "" } }
> >> >>
> >> >> Basically, this is how I want it to look:
> >> >>
> >> >> Attention: (variable AttentionLine)
> >> >> Referring Physician: (variable ReferringPhysician)
> >> >>
> >> >> Dear {REF AttentionLine} or {REF ReferringPhysician} or blank
> >> >>
> >> >> The "Dear REF" is what I am trying to address here.
> >> >>
> >> >> Hope this is clear and someone can help.
> >> >>
> >> >> Thank you!
> >> >>
> >> >>
> >> >> --
> >> >> singeredel
> >>
> >>
>
>

Re: Nest If Statements in REF Field by macropod

macropod
Tue Dec 04 23:54:21 PST 2007

Hi singeredel,

To see how to use this technique more generally, and how to do a wide range of other calculations in Word, check out my Word Field
Maths 'tutorial', at:
http://www.wopr.com/cgi-bin/w3t/showthreaded.pl?Number=365442
or
http://www.gmayor.com/downloads.htm#Third_party

Cheers
--
macropod
[MVP - Microsoft Word]
-------------------------

"singeredel" <singeredel@discussions.microsoft.com> wrote in message news:83E05897-FD73-4E2A-BE31-3B1B643C5A50@microsoft.com...
> Yes! This works! Thank you so much! Unfortunately, I cannot figure out how to
> read this so that I can understand the process and apply it to other
> applications, but it does work...
> --
> singeredel
>
>
> "macropod" wrote:
>
>> Hi singeredel,
>>
>> OK, try this construction:
>> {IF{={IF{REF AttentionLine}= "Error*" 1 0}+{IF{REF AttentionLine}= "" 1 0}}> 0 {IF{={IF{REF ReferringPhysician}= "Error*" 1
>> 0}+{IF{REF ReferringPhysician}= "" 1 0}}> 0 "" {REF ReferringPhysician}} {REF AttentionLine}}
>>
>> Cheers
>> --
>> macropod
>> [MVP - Microsoft Word]
>> -------------------------
>>
>> "singeredel" <singeredel@discussions.microsoft.com> wrote in message news:AD30CC8A-5C22-4D7B-81E4-7D54FD8DA564@microsoft.com...
>> > What is happening with this suggestion is that when the empty bookmark
>> > AttentionLine is deleted, the end result leaves the "Dear REF field" blank
>> > even if there is a variable in the bookmark ReferringPhysician, whereas it
>> > should only be blank if both AttentionLine and ReferringPhysician are
>> > missing.
>> >
>> > The sequence should be to use the variable in AttentionLine first. If that
>> > is blank, then use the Referring Physician variable. If both are blank, leave
>> > Dear "REF Field" blank and don't don't pop an error when bookmarks are
>> > deleted.
>> >
>> > I don't know if this is possible or not.
>> >
>> > Thanks so much for your help!
>> > --
>> > singeredel
>> >
>> >
>> > "macropod" wrote:
>> >
>> >> Hi singeredel,
>> >>
>> >> The following will suppress the error message in the absence of either or both bookmarks:
>> >> {IF{REF AttentionLine}= "Error*" "" {IF{REF AttentionLine}= "" {IF{REF ReferringPhysician}= "Error*" "" {IF{REF
>> >> ReferringPhysician}=
>> >> "" "" {REF ReferringPhysician}}} {REF AttentionLine}}}
>> >>
>> >> Cheers
>> >> --
>> >> macropod
>> >> [MVP - Microsoft Word]
>> >> -------------------------
>> >> PS: None of this is vba.
>> >>
>> >> "singeredel" <singeredel@discussions.microsoft.com> wrote in message
>> >> news:DF7FD28B-5BD3-4B84-810D-FEAD3C0AA2D4@microsoft.com...
>> >> > Hi again. I need to modify this further to include an IF condition for the
>> >> > bookmark not being found. The prior nested code works fine until I have to
>> >> > delete the area in the document where the bookmark turns out to be empty.
>> >> > When I delete the bookmarked area, it then pops an Error! message that the
>> >> > reference source is not found. For example, even if the Dear {REF
>> >> > ReferringPhysician} puts in the name, when I delete the empty text for
>> >> > AttentionLine that includes the bookmark, I then get an error showing.
>> >> >
>> >> > i.e., I need it to do nothing and not pop and error if the referenced
>> >> > bookmark does not exist, so that when I delete the empty line of text that
>> >> > contains the bookmark, there is not an error.
>> >> >
>> >> > Attention: (empty variable) -- this bookmark has no information and the
>> >> > line eventually gets deleted because it is blank.
>> >> >
>> >> > Referring Physician: Dr. A (variable) -- this bookmark has information
>> >> > which shows in the REF next to "Dear "
>> >> >
>> >> > Dear Dr. A: (this becomes an error once the AttentionLine bookmark gets
>> >> > deleted.
>> >> >
>> >> >