Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ConvertToText from VBA to Vbscript

Status
Not open for further replies.

Lohn

Programmer
Jun 27, 2004
2
IT
I have a .vbs file that makes various operation on a excel file and then paste some text from it in Word.
Obviously the text is pasted into Word in a table and i want to convert it in simple text separated by tab.

Vba code to do that is:


Set objWD = WScript.CreateObject ("Word.Application")

objWD.Selection.Tables(1).Select
objWD.Selection.Rows.ConvertToText Separator:=wdSeparateByTabs, NestedTables:= True


This code doesn't work in vbscript... how can i "convert" it to use in a .vbs file? I think the problem is in the ":=" part of the code but i don't know how to fix this...

Thx in advance for your help and time ;)
 
Hello Lohn,

The general approach be making it positional:
Code:
objWD.Selection.Tables(1).Select
objWD.Selection.Rows.ConvertToText 1, True
regards - tsuji

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top