i want to find specific text in a OldDoc.docx and replace it with another text and then save it as Newdoc.docx at another location
My codes are-
Code: Select all
f1::
Gui, Add, Edit, x252 y20 w100 h30 vdate,
Gui, Add, Text, x142 y20 w100 h30 , Date
gui, add, button, x142 y230 w100 h30, ok
Gui, Show, w479 h379, Untitled GUI
return
buttonOk:
gui, submit
ow:= ComObjCreate("word.application")
ow1:= ow.documents.Open("D:\14.1.18\words\OldDoc.docx")
st:= "14.01.2018"
ow1.selection.find.execute(st,0,0,0,0,0,1,1,0,date,2)
ow1.saveas("C:\Users\htc\Desktop\NewDoc.docx")
return
however it creates NewDoc.docx at C:\Users\htc\Desktop\NewDoc.docx but it does not replace the date in it.
please tell me the solution of the problem...
thanks a lot..