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.
>> >> >
>> >> >