[RESOLVED] [vb6] How to insert a tabspace in Word Object?
Hi.
I have a textbox that I filled like this:
Code:
TextBox = "1" & vbtab & "2" & vbNewLine _
& "3333" & vbtab & "4"
(I previoulsy fixed the tabs positions, but that doesn't matter here)
Now I open a template file in Word Object, set like this:
Code:
Public Obj_Word As Object
Set Obj_Word = CreateObject("Word.Application")
and pass that textbox to the file, but the columns does not stick to the tabs in the word. In the example I wrote here, the output would be: numbers 2 and 4 not in the same horizontal space.
To be clear, my only problem is: The tabs (perfectly shown in textbox) are gone in Word. How do I insert a tabspace character in Word?
Re: [vb6] How to insert a tabspace in Word Object?
did you try replacing vbtab with ^t ?
Re: [vb6] How to insert a tabspace in Word Object?
Please show the code snippet where you set the Word text. This does not make sense as this VBA code inserts tabs.
Code:
Private Sub UserForm_Initialize()
TextBox1.Text = "1" & vbTab & "2" & vbNewLine & "3333" & vbTab & "4" & vbNewLine
End Sub
Private Sub CommandButton1_Click()
Dim para As Paragraph
Set para = ActiveDocument.Paragraphs.Add
para.Range.Text = TextBox1.Text
End Sub
Re: [RESOLVED] [vb6] How to insert a tabspace in Word Object?
Apparently, the tabspace were right, they were succesfully passed from the textbox to the Word Object. The tabspaces didn't match my previously-set tabs in Word because I was setting them inside the frame, instead of globally, outside the frame.
Sorry, my mistake.
Thank you.