PDA

View Full Version : Need to insert TAB in word document



shekhu
08-19-2011, 06:52 AM
Hi,

I am using the following macro:

Sub Insert_QA()
Selection.TypeParagraph
Selection.TypeParagraph
Selection.TypeText Text:="Q:^t?"
Selection.TypeParagraph
Selection.TypeText Text:="A:^t."
Selection.MoveUp Unit:=wdLine, Count:=2
End Sub

When I run the macro to insert the above mentioned text, it displays ^t symbol instead of a TAB.

My issue is that I need "A: " instead of getting as "A:^t".

It would be great if someone could suggest me a way out.

Thanks

Frosty
08-19-2011, 09:37 AM
Selection.TypeText Text:="A:" & vbtab

The ^t is the code for finding/inserting a tab when doing a Find, but it's meaningless in the VBA code.

However, if you record a macro, you should see this as well

shekhu
08-20-2011, 01:16 AM
Thanks a lot Frosty, this solves my purpose.