I have written an EXCEL VBA macro which opens a Word document and I need to select the 4th line in the Word Document FROM the Excel VBA macro. I've been reading up on this for hours and cannot figure out how to do it.
The cursor is already positioned at "National Maritime Center" (see below) and the 4th line begins with "D032DG".
Tried were:
Selection.MoveDown Unit:=wdLine, Count:=4 (with and without WordApp. as the word object).
Selection.Goto What:=wdGoToLine, Which:=wdGoToAbsolute, Count:=4 (with and without WordApp. as the word object).
Application.VBE.ActiveCodePane.SetSelection 4, 1, 4, 1
Nothing works. Please advise.
National Maritime Center
Keep ’em Safe, Keep ’em Sailing
________________________________________
D032DG
Thanks,
Roger
The cursor is already positioned at "National Maritime Center" (see below) and the 4th line begins with "D032DG".
Tried were:
Selection.MoveDown Unit:=wdLine, Count:=4 (with and without WordApp. as the word object).
Selection.Goto What:=wdGoToLine, Which:=wdGoToAbsolute, Count:=4 (with and without WordApp. as the word object).
Application.VBE.ActiveCodePane.SetSelection 4, 1, 4, 1
Nothing works. Please advise.
National Maritime Center
Keep ’em Safe, Keep ’em Sailing
________________________________________
D032DG
Thanks,
Roger