Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
I wish to do something very straight forward:
Here is what I've got from a recorded macro. It is far from workable:
wordapp = objectopen("Word.Application") docs=wordapp.documents docs.open(docPathName) wordapp.visible=@true thisdoc = wordapp.activedocument s=wordapp.selection s.GoTo(wdGoToLine,1) while @true s.EndKey(:: Unit:=wdLine, Extend:=wdExtend) s.Copy line = clipGet() ; process line s.MoveRight(:: Unit:=wdCharacter, Count:=1) endWhile thisdoc.close() objectclose(thisdoc) objectclose(docs) objectclose(wordapp)
;Constant values defined wdGoToLine = 3 wdLine = 5 wdExtend = 1 wdCharacter = 1 file= "%dir%\name.doc" if appExist("winword.exe") oWORD = ObjectAccess("Word.Application", @false) newWord = @false else oWORD = ObjectOpen("Word.Application") newWord = @true endIf oDOCS = oWORD.Documents oDOC = oDOCS.Open(file) oWORD.visible=@true oActiveDoc = oWORD.activedocument oSel=oWORD.selection oSel.GoTo(wdGoToLine,1) count = 1 while @true oSel.EndKey(:: Unit=wdLine, Extend=wdExtend) oSel.Copy line = clipGet() Message("Line %count%",line) oSel.MoveRight(:: Unit=wdCharacter, Count=1) if oSel.MoveRight == 0 then break oSel.MoveLeft(:: Unit=wdCharacter, Count=1) ; compensate for MoveRight count = count+1 endWhile oActiveDoc.close() objectclose(oSel) objectclose(oActiveDoc) objectclose(oDOC) objectclose(oDOCS) if newWord oWord.Quit endIf objectclose(oWORD) exit
Article ID: W16147
File Created: 2006:01:13:14:36:12
Last Updated: 2006:01:13:14:36:12