• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1996
  • Last Modified:

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?
  • 2
1 Solution
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
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.
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'.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now