Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Using double quotes in IF results
Does anyone know how to include double quotes in the results of an IF
express, as in: { IF TextString = "anytext" "This is the "true" result" "This is the "false" result" } Any help is greatly appreciated. |
#2
|
|||
|
|||
Use a nested {Symbol 034} field in each place you want the quote symbol
to appear. E.g., "....{Symbol 034}true{Symbol 034}..." |
#3
|
|||
|
|||
034 will give you straight quotes. If you want the curly ones, you'll need
to use 147 (left) and 148 (right). Alternatively, you can use two single quotes. -- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA Word MVP FAQ site: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. "Greg" wrote in message ps.com... Use a nested {Symbol 034} field in each place you want the quote symbol to appear. E.g., "....{Symbol 034}true{Symbol 034}..." |
#4
|
|||
|
|||
Thanks to both of you for your responses. Unfortunately, this doesn't always
work. Specifically, it's failing for me if the {symbo} field is the first or last thing in the result text. Try this: { IF "a"="b" "{Symbol 034}text1{Symbol 034}" "{Symbol 034}text2{Symbol 034}" } Yields: text2 Now try this: { IF "a"="b" "my{Symbol 034}true{Symbol 034}text" "my{Symbol 034}false{Symbol 034}text" } Yields: my"false"text I can only speculate why Word is dropping the quotes in the first example. Is this a bug or is there some nuance of this feature that is eluding me? If all else fails I can continue to use two single quotes. Again, any help you can provide is greatly appreciated. "Suzanne S. Barnhill" wrote: 034 will give you straight quotes. If you want the curly ones, you'll need to use 147 (left) and 148 (right). Alternatively, you can use two single quotes. -- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA Word MVP FAQ site: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. "Greg" wrote in message ps.com... Use a nested {Symbol 034} field in each place you want the quote symbol to appear. E.g., "....{Symbol 034}true{Symbol 034}..." |
#5
|
|||
|
|||
Joey,
Odd. Replace { Symbol 034 } with { Quote 34 }. That is working here with your example. -- Greg Maxey/Word MVP A Peer in Peer to Peer Support Joey wrote: Thanks to both of you for your responses. Unfortunately, this doesn't always work. Specifically, it's failing for me if the {symbo} field is the first or last thing in the result text. Try this: { IF "a"="b" "{Symbol 034}text1{Symbol 034}" "{Symbol 034}text2{Symbol 034}" } Yields: text2 Now try this: { IF "a"="b" "my{Symbol 034}true{Symbol 034}text" "my{Symbol 034}false{Symbol 034}text" } Yields: my"false"text I can only speculate why Word is dropping the quotes in the first example. Is this a bug or is there some nuance of this feature that is eluding me? If all else fails I can continue to use two single quotes. Again, any help you can provide is greatly appreciated. "Suzanne S. Barnhill" wrote: 034 will give you straight quotes. If you want the curly ones, you'll need to use 147 (left) and 148 (right). Alternatively, you can use two single quotes. -- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA Word MVP FAQ site: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. "Greg" wrote in message ps.com... Use a nested {Symbol 034} field in each place you want the quote symbol to appear. E.g., "....{Symbol 034}true{Symbol 034}..." |
#6
|
|||
|
|||
Or even cleaner with your example:
{ IF "a"="b"{ Quote 34 text1 34 }{ Quote 34 text2 34}} -- Greg Maxey/Word MVP A Peer in Peer to Peer Support Joey wrote: Thanks to both of you for your responses. Unfortunately, this doesn't always work. Specifically, it's failing for me if the {symbo} field is the first or last thing in the result text. Try this: { IF "a"="b" "{Symbol 034}text1{Symbol 034}" "{Symbol 034}text2{Symbol 034}" } Yields: text2 Now try this: { IF "a"="b" "my{Symbol 034}true{Symbol 034}text" "my{Symbol 034}false{Symbol 034}text" } Yields: my"false"text I can only speculate why Word is dropping the quotes in the first example. Is this a bug or is there some nuance of this feature that is eluding me? If all else fails I can continue to use two single quotes. Again, any help you can provide is greatly appreciated. "Suzanne S. Barnhill" wrote: 034 will give you straight quotes. If you want the curly ones, you'll need to use 147 (left) and 148 (right). Alternatively, you can use two single quotes. -- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA Word MVP FAQ site: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. "Greg" wrote in message ps.com... Use a nested {Symbol 034} field in each place you want the quote symbol to appear. E.g., "....{Symbol 034}true{Symbol 034}..." |
#7
|
|||
|
|||
Joey,
Here is an example when the quoted text is first, last, or in the middle. { IF "a"="a"{ Quote 34 True 34 }{ Quote "This is a " 34 false 34 " statement" }} -- Greg Maxey/Word MVP A Peer in Peer to Peer Support Joey wrote: Thanks to both of you for your responses. Unfortunately, this doesn't always work. Specifically, it's failing for me if the {symbo} field is the first or last thing in the result text. Try this: { IF "a"="b" "{Symbol 034}text1{Symbol 034}" "{Symbol 034}text2{Symbol 034}" } Yields: text2 Now try this: { IF "a"="b" "my{Symbol 034}true{Symbol 034}text" "my{Symbol 034}false{Symbol 034}text" } Yields: my"false"text I can only speculate why Word is dropping the quotes in the first example. Is this a bug or is there some nuance of this feature that is eluding me? If all else fails I can continue to use two single quotes. Again, any help you can provide is greatly appreciated. "Suzanne S. Barnhill" wrote: 034 will give you straight quotes. If you want the curly ones, you'll need to use 147 (left) and 148 (right). Alternatively, you can use two single quotes. -- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA Word MVP FAQ site: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. "Greg" wrote in message ps.com... Use a nested {Symbol 034} field in each place you want the quote symbol to appear. E.g., "....{Symbol 034}true{Symbol 034}..." |
#8
|
|||
|
|||
And if all else fails save the texts as autotext entries and insert autotext
fields in the conditional statement to place them. -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Greg Maxey wrote: Joey, Here is an example when the quoted text is first, last, or in the middle. { IF "a"="a"{ Quote 34 True 34 }{ Quote "This is a " 34 false 34 " statement" }} Joey wrote: Thanks to both of you for your responses. Unfortunately, this doesn't always work. Specifically, it's failing for me if the {symbo} field is the first or last thing in the result text. Try this: { IF "a"="b" "{Symbol 034}text1{Symbol 034}" "{Symbol 034}text2{Symbol 034}" } Yields: text2 Now try this: { IF "a"="b" "my{Symbol 034}true{Symbol 034}text" "my{Symbol 034}false{Symbol 034}text" } Yields: my"false"text I can only speculate why Word is dropping the quotes in the first example. Is this a bug or is there some nuance of this feature that is eluding me? If all else fails I can continue to use two single quotes. Again, any help you can provide is greatly appreciated. "Suzanne S. Barnhill" wrote: 034 will give you straight quotes. If you want the curly ones, you'll need to use 147 (left) and 148 (right). Alternatively, you can use two single quotes. -- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA Word MVP FAQ site: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. "Greg" wrote in message ps.com... Use a nested {Symbol 034} field in each place you want the quote symbol to appear. E.g., "....{Symbol 034}true{Symbol 034}..." |
#9
|
|||
|
|||
On Wed, 2 Feb 2005 09:35:03 -0800, "Joey"
wrote: Does anyone know how to include double quotes in the results of an IF express, as in: { IF TextString = "anytext" "This is the "true" result" "This is the "false" result" } Any help is greatly appreciated. Below are a few methods. Note that it comes out somewhat hard to read in the newsgroup because both the straight and curly quotes look the same. You will need to use a bit of imagination to get the picture. The idea is that the quote marks around the target quotation are supposed to be curly, and the quote marks that separate portions of the field codes are supposed to be straight. Bob S Quoted Text in IF Fields Trying to put text that contains embedded quotation marks into the true or false text of IF field codes can be "interesting". There are a couple ways to do it. As an example, suppose that you want the output of an IF field to look like this: Say "cheese!" One scheme is to use the QUOTE field to produce the correct quotes. For example: { IF Something "Say { QUOTE "\"" }cheese!{ QUOTE "\"" }" "No!" } It is inordinately difficult to get this to work. The only way that I could get the QUOTE fields correct was to use CTRL+F9 to get the brackets and type directly. Using the Insert | Field dialog produced straight quotes not curly quotes. Also note that to get the opening quotes in the first QUOTE field, I typed "\ "" and then deleted the space character. Another alternative is to use a pair of single quote characters to make something that looks somewhat like double quotes: { IF Something "Say ''cheese!''" "No!" } Again, it is unreasonably difficult to get this to work. I had to use CTRL+F9 to get the brackets (instead of Insert | Field), then type QUOTE instead of IF (If I used IF I would get straight quotes when I typed the rest of the text!) and type in the rest of the field, and then go back and change the QUOTE to IF. Also, to get the two single opening quotes I had to start with a space between them and then delete the space. While you are trying these things, remember to update field codes every time that you change something. My favorite scheme at the moment is to first type the correct text, type QUOTE in front of it, put backslashes in front of the internal quote characters, add the straight quote characters needed by the QUOTE field, use CTRL+F9 to put field brackets around it, type in the rest of the IF field stuff, and then select the whole field code and use CTRL+F9 to put field brackets around that. It all has to be done in order. The process is: Say "cheese!" QUOTE Say "cheese!" QUOTE Say \"cheese!\" QUOTE "Say \"cheese!\"" { QUOTE "Say \"cheese!\""} { IF Something { QUOTE "Say \"cheese!\""} "No!" } A different approach was suggested by "macropod". Use the ASCII numbers for the quote characters, inside QUOTE fields. { IF Something "Say { QUOTE 34 }cheese!{ QUOTE 34 }" "No!" } 34 straight double quote 147 left curly double quote 148 right curly double quote 39 straight single quote 145 left curly single quote 146 right curly single quote |
#10
|
|||
|
|||
Also note that to get the opening
quotes in the first QUOTE field, I typed "\ "" and then deleted the space character. Not necessary if you use the keyboard shortcuts to insert these directly:\ Ctrl+`, ` = opening single quote Ctrl+', ' = closing single quote or apostrophe -- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA Word MVP FAQ site: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. "Bob S" wrote in message news On Wed, 2 Feb 2005 09:35:03 -0800, "Joey" wrote: Does anyone know how to include double quotes in the results of an IF express, as in: { IF TextString = "anytext" "This is the "true" result" "This is the "false" result" } Any help is greatly appreciated. Below are a few methods. Note that it comes out somewhat hard to read in the newsgroup because both the straight and curly quotes look the same. You will need to use a bit of imagination to get the picture. The idea is that the quote marks around the target quotation are supposed to be curly, and the quote marks that separate portions of the field codes are supposed to be straight. Bob S Quoted Text in IF Fields Trying to put text that contains embedded quotation marks into the true or false text of IF field codes can be "interesting". There are a couple ways to do it. As an example, suppose that you want the output of an IF field to look like this: Say "cheese!" One scheme is to use the QUOTE field to produce the correct quotes. For example: { IF Something "Say { QUOTE "\"" }cheese!{ QUOTE "\"" }" "No!" } It is inordinately difficult to get this to work. The only way that I could get the QUOTE fields correct was to use CTRL+F9 to get the brackets and type directly. Using the Insert | Field dialog produced straight quotes not curly quotes. Also note that to get the opening quotes in the first QUOTE field, I typed "\ "" and then deleted the space character. Another alternative is to use a pair of single quote characters to make something that looks somewhat like double quotes: { IF Something "Say ''cheese!''" "No!" } Again, it is unreasonably difficult to get this to work. I had to use CTRL+F9 to get the brackets (instead of Insert | Field), then type QUOTE instead of IF (If I used IF I would get straight quotes when I typed the rest of the text!) and type in the rest of the field, and then go back and change the QUOTE to IF. Also, to get the two single opening quotes I had to start with a space between them and then delete the space. While you are trying these things, remember to update field codes every time that you change something. My favorite scheme at the moment is to first type the correct text, type QUOTE in front of it, put backslashes in front of the internal quote characters, add the straight quote characters needed by the QUOTE field, use CTRL+F9 to put field brackets around it, type in the rest of the IF field stuff, and then select the whole field code and use CTRL+F9 to put field brackets around that. It all has to be done in order. The process is: Say "cheese!" QUOTE Say "cheese!" QUOTE Say \"cheese!\" QUOTE "Say \"cheese!\"" { QUOTE "Say \"cheese!\""} { IF Something { QUOTE "Say \"cheese!\""} "No!" } A different approach was suggested by "macropod". Use the ASCII numbers for the quote characters, inside QUOTE fields. { IF Something "Say { QUOTE 34 }cheese!{ QUOTE 34 }" "No!" } 34 straight double quote 147 left curly double quote 148 right curly double quote 39 straight single quote 145 left curly single quote 146 right curly single quote |
#11
|
|||
|
|||
What am I missing here? The sequence I need here (which I admit is not
instantly apparent from the text-only newsgroup posting) is straight double quote backslash opening curly double quote straight double quote The straight quotes are needed for the QUOTE field code, the curly quote is ultimately part of the quoted text. With automatic curly quotes enabled, the way I get it is double quote ^z to undo curliness backslash space double quote - automatically becomes opening curly quote; without the space it becomes a closing curly qoute instead delete the space double quote ^z to undo curliness How do shortcuts for single quotes ease this process? Bob S On Wed, 9 Feb 2005 17:47:35 -0600, "Suzanne S. Barnhill" wrote: Also note that to get the opening quotes in the first QUOTE field, I typed "\ "" and then deleted the space character. Not necessary if you use the keyboard shortcuts to insert these directly:\ Ctrl+`, ` = opening single quote Ctrl+', ' = closing single quote or apostrophe One scheme is to use the QUOTE field to produce the correct quotes. For example: { IF Something "Say { QUOTE "\"" }cheese!{ QUOTE "\"" }" "No!" } It is inordinately difficult to get this to work. The only way that I could get the QUOTE fields correct was to use CTRL+F9 to get the brackets and type directly. Using the Insert | Field dialog produced straight quotes not curly quotes. Also note that to get the opening quotes in the first QUOTE field, I typed "\ "" and then deleted the space character. |
#12
|
|||
|
|||
You don't need the QUOTE field at all if you use single quotes, and they
don't require backslashes. That is, instead of using double quotes with a backslash (which often doesn't work for the closing one, anyway, use two single quotes instead. -- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA Word MVP FAQ site: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. "Bob S" wrote in message ... What am I missing here? The sequence I need here (which I admit is not instantly apparent from the text-only newsgroup posting) is straight double quote backslash opening curly double quote straight double quote The straight quotes are needed for the QUOTE field code, the curly quote is ultimately part of the quoted text. With automatic curly quotes enabled, the way I get it is double quote ^z to undo curliness backslash space double quote - automatically becomes opening curly quote; without the space it becomes a closing curly qoute instead delete the space double quote ^z to undo curliness How do shortcuts for single quotes ease this process? Bob S On Wed, 9 Feb 2005 17:47:35 -0600, "Suzanne S. Barnhill" wrote: Also note that to get the opening quotes in the first QUOTE field, I typed "\ "" and then deleted the space character. Not necessary if you use the keyboard shortcuts to insert these directly:\ Ctrl+`, ` = opening single quote Ctrl+', ' = closing single quote or apostrophe One scheme is to use the QUOTE field to produce the correct quotes. For example: { IF Something "Say { QUOTE "\"" }cheese!{ QUOTE "\"" }" "No!" } It is inordinately difficult to get this to work. The only way that I could get the QUOTE fields correct was to use CTRL+F9 to get the brackets and type directly. Using the Insert | Field dialog produced straight quotes not curly quotes. Also note that to get the opening quotes in the first QUOTE field, I typed "\ "" and then deleted the space character. |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Smart Quotes to straight quotes (apostrophe) | Microsoft Word Help | |||
How to get mail merge to use double quotes | Mailmerge | |||
Prevent double quote in form field | Microsoft Word Help | |||
Get rid of Double Spacing | New Users | |||
i can't double type letters why? | Microsoft Word Help |