My code opens an embedded MS Word object that has a table in it. It successfully enters text and moves from cell to cell, but I need to be able to query which table column I’m in because the starting cell is supposed to be variable and one column is not supposed to receive any text.Here’s what is working:
===============================
Set wordobjOLEhandle = embeddedobj.Activate(True)
Set MSWord = wordobjOLEhandle.Application
Call MSWord.Selection.MoveDown(wdLine, rowoffset)
Call MSWord.Selection.MoveRight(wdCell, columnoffset)
wdCell = 12 'MS Word VBA constant
wdLine = 5 'MS Word VBA constant
For i = 0 To Ubound(item.Values)
Call MSWord.Selection.TypeText(“my text”)
Call MSWord.Selection.TypeParagraph
Call MSWord.Selection.TypeText(“next line of text”)
Call MSWord.Selection.MoveRight(wdCell, 1)
'what goes here?
Next
===============================
Can anyone give me the syntax of line which essentially says, “if I’m in the third column, then moveright one more cell”?
TIA,
Bill