We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now

x

Using If Statements in Word 2003  and bullet points

meperera
meperera asked
on
Medium Priority
1,960 Views
Last Modified: 2012-05-06
Hi Experts,
I have a word document where I have a few If statements  to add some sentences depending on the value of merge fields. I have attached the code below . I need to add 12 statements with bullet points. My only problem is that when the merge field is blank it still shows a blank bullet point.
Is there a way to not show the bullet point and  and move the next bullet point up ?

Thanks in advance
"	{IF {MERGEFIELD M_385}   <> This is sentence 1.  }
"	{IF {MERGEFIELD M_386}   <> This is sentence 2.  }
"	{IF {MERGEFIELD M_387}   <> This is sentence 3.  }
"	{IF {MERGEFIELD M_388}   <> This is sentence 4.  }

Open in new window

Comment
Watch Question

GrahamSkanRetired
CERTIFIED EXPERT
Top Expert 2012

Commented:
You will need to move the paragraph into the True part of the IF field

{ IF { MERGEFIELD MyField} <> "" "{ MERGEFIELD MyField}}¶
}

Author

Commented:
Hi Graham,
Could you please explain this further ? I think I'm getting confused about where ¶ and the curly brackets.
Could you also kindly add this to my example ?

{IF {MERGEFIELD M_388}   <> This is sentence 4.  }

Author

Commented:
The inverted commas become boxes when I post the comment
GrahamSkanRetired
CERTIFIED EXPERT
Top Expert 2012

Commented:
It isn't clear what you are trying to do. You test the value of the merge fields, but there is no True text (nor optional False text). What do you want to happen if the merge field value is not "This is sentence 4"?

Author

Commented:
Sorry that I didn't make myself clear. Okay here's the deal. I want to be able to check if each field has a value (it can be anything) If the value is non blank I want to insert a sentence (each sentence depends on the merge field ). Then have all the sentences bulleted.

Sincerely appreciate your assistance
Retired
CERTIFIED EXPERT
Top Expert 2012
Commented:
Make sure that the paragraphs are already bulleted.


" { IF { MERGEFIELD MyField} <> "" "This sentence¶
"}

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
GrahamSkanRetired
CERTIFIED EXPERT
Top Expert 2012

Commented:
I now notice that what looked like a bullet at the beginning of the line when I composed the text has been reproduced as a double quote character.

Author

Commented:
I believe I'm doing exactly what you have suggested. But I'm getting empty bullets when the merge field value is blank. what am I doing wrong ? I have attached my document if you could kindly take a look at.
clinical.doc
GrahamSkanRetired
CERTIFIED EXPERT
Top Expert 2012

Commented:
You seem to have used the graphics character that Word (and I ) use to represent a paragraph to show the end of a paragraph.

Sorry about that misunderstanding. To create a paragraph, just hit "Enter".  If you show the formatting marks with the 'Show/ Hide" button ( ¶), a paragraph mark will appear as that symbol at the end of a paragraph but it is simply a display marker to show the end of a paragraph.

The same symbol can be independently inserted into the text (with Alt + 0182), both here and in Word, but it is not a paragraph mark in that case, so you can't simply copy it into your text.

Author

Commented:
Cheers Graham, Unfortunately still I can't seem to get rid of the empty bullets. Anything else  I should be doing ?

Author

Commented:
any comments ?
GrahamSkanRetired
CERTIFIED EXPERT
Top Expert 2012

Commented:
Sorry. Been a bit tied up.
In your sample document you have used character ¶ instead of a paragraph. When Word is set to display formatting characters, you will see the same symbol at the end of paragraphs, which are simply created by hitting the Enter key.

Author

Commented:
Hi Graham, I got the paragraph part okay thank you. I 'm having issues with the bullets. Could you please look at the attached document when you have  second .  I greatly appreciate your help once again.
clinical-Second.doc
GrahamSkanRetired
CERTIFIED EXPERT
Top Expert 2012

Commented:
Each field was in its own paragraph (external to the field). I have removed them
GrahamSkanRetired
CERTIFIED EXPERT
Top Expert 2012

Commented:
But forgot to attach the result
GrahamSkanRetired
CERTIFIED EXPERT
Top Expert 2012

Commented:

Author

Commented:
Thanks Graham. You are a champion. One small thing if you get a second. The bullets disappear when the real data is displayed. Is there anything that can be done about that ?
GrahamSkanRetired
CERTIFIED EXPERT
Top Expert 2012

Commented:
In my tests, they aren't visible in the preview, but are there in the result document.
GrahamSkanRetired
CERTIFIED EXPERT
Top Expert 2012

Commented:
I did change the bullet type. To change then back, you can select the whole block and apply the bullets in one go.

Author

Commented:
Cheers Graham, unfortunately I couldn't get the bullets to come up. However I found a workaround to have a the bullet point character at the beginning of each sentence.

Thanks a million for your help and patience. If I had 50,000 points to give I would definitely give you that.

Author

Commented:
This is the best solution I have been given by anyone in this forum. Really appreciate your patience. Good luck. Thank you once again.
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.