Word 2010 - Mail Merge - Conditionally Inserting the TAB CHARACTER

In most Word search-and-replace operations, the Tab Character is represented by "^t" (caret-t). However, when I try to insert a Tab Character as part of Mail Merge's "Text To Be Inserted Before" (when editing a field code), I get a literal ^t and not a Tab Character (action). The same is true if I try to use an IF() statement to conditionally insert a Tab Character. I only get ^t.

I have a mail merge document where I want to use a tab with a dotted leader, but only when that field is populated. I don't want a string of dots if there's no value in that field.

Q. - How can you conditionally insert a Tab Character (action) in a Word Mail Merge?
GrayStricklandAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

GrahamSkanRetiredCommented:
Yes the ^t representation only applies to Find and Replace.

In VBA, you can use vbTab
In the text, the tab key will (normally) insert a tab character. If you turn on the option to see formatting characters - use the show/hide(¶) toggle button - the tab character will appear as a right-pointing arrow.
It would look something like this with field codes also displayed (Alt+F9 toggle).

{ IF { MERGEFIELD MyField } = "Yes"  " ->" "" }

 An actual picture is attached
Merge-Fields.JPG
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
GrayStricklandAuthor Commented:
I work with characters revealed 99% of the time. I have since Word 1.0 for DOS (or whenever they implemented it -- I've used every version since 1984). However, it never occurred to me to simply copy a tab and paste it into my IF statement. It works, for which I am very grateful.
0
GrahamSkanRetiredCommented:
Thanks Gary. I think that you should be able to type 'Tab' directly where needed.

I confess that I only jumped into Word at Version 2 (for DOS). At the time, we mainly used our screens to connect to a mainframe (running GCOS64 or GCOS7), so PC apps were a bit of a curiosity. If we had Windows it was also version 2, but the company couldn't afford to buy mouse devices (mice?) for all of us, so we didn't get the point.

I remember Windows 3 as a complete revolution, where we all 'got it'.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Word

From novice to tech pro — start learning today.