Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

WORD-OLE

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
integer result

result = o1.ConnectToNewObject("word.application.9")
IF result <> 0 THEN
DESTROY o1
MessageBox(&quot;OLE Error&quot;, &
&quot;Unable to connect to Microsoft Word. &quot; &
+ &quot;Code: &quot; &
+ String(result))
DESTROY o1
RETURN
END IF


ole_1.Activate(OffSite!)
ChangeDirectory( &quot;c:\cenk&quot; )
integer li_res
is_cenk =sle_1.text
if is_cenk=&quot;&quot; then
messagebox(&quot;dikkat&quot;,&quot;Herhangi bir document adý girmediniz&quot;)
return 0
elseif FileExists(is_cenk) = false then

li_res =messagebox(&quot;hata&quot;,&quot;var olmayan document girildi!Yaratmak istermisin?&quot;,Question!,YesNo!,1)
if li_res = 1 then
o1.Application.Run(&quot;FileNew&quot;)
o1.Application.Visible = true
else
return 0
end if
else
is_doc =is_cenk+&quot;.doc&quot;
is_cenk =&quot;c:\cenk\&quot;+is_cenk+&quot;.doc&quot;
messagebox(&quot;Seçilen Dizin&quot;,is_cenk)
o1.Application.Visible = true
o1.Documents.Open(is_cenk)
end if

****What i wanna know is, i want 2 convert the code above to open a word document INTO the OLE control and write somethings in the document then save it with changes.But i couldnt manage!!! above code opens document not IN an OLE control.WOULD YOU PLEASE HELP ME !THANKS
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top