Hi,
I'm trying to do a find and replace using the oleobject connected to a word document. Code is written below and it is crashing. Any leads, answers and solutions will be greatly appreciated.
Thanks,
Tina
--------------------------------------------------
oleobject ole_object1
oleobject ole_wordfind
integer result, li_rc
string ls_file = "C:\No detainer letter.doc"
string ls_null
setnull(ls_null)
ole_object1 = CREATE OLEObject
result = ole_object1.ConnectToNewObject("word.application")
ole_object1.Documents.open("C:\Derived.doc")
ole_object1.Selection.Find.Forward=True
ole_object1.Selection.ClearFormatting
ole_wordfind = ole_object1.Selection.Find
result = ole_wordfind.Execute("<letter_date_literal>",0,0,0,0,0,1,1,ls_null,"July 1, 2007","July 1, 2007",0,0,0,0)
ole_object1.activedocument.saveas("C:\Derived.doc")
Thanks,
Tina
I'm trying to do a find and replace using the oleobject connected to a word document. Code is written below and it is crashing. Any leads, answers and solutions will be greatly appreciated.
Thanks,
Tina
--------------------------------------------------
oleobject ole_object1
oleobject ole_wordfind
integer result, li_rc
string ls_file = "C:\No detainer letter.doc"
string ls_null
setnull(ls_null)
ole_object1 = CREATE OLEObject
result = ole_object1.ConnectToNewObject("word.application")
ole_object1.Documents.open("C:\Derived.doc")
ole_object1.Selection.Find.Forward=True
ole_object1.Selection.ClearFormatting
ole_wordfind = ole_object1.Selection.Find
result = ole_wordfind.Execute("<letter_date_literal>",0,0,0,0,0,1,1,ls_null,"July 1, 2007","July 1, 2007",0,0,0,0)
ole_object1.activedocument.saveas("C:\Derived.doc")
Thanks,
Tina