learn
asked on
about getobject
What wrong I did:
1. in Win95, click at file c:\myfile.txt, Notepad actived with myfile.txt appeared. That means .txt is registed and the automation interface is OK.
2. excuted code
dim act as object
set act = getobject("c:\myfile.txt")
and got "not find file..." error.
1. in Win95, click at file c:\myfile.txt, Notepad actived with myfile.txt appeared. That means .txt is registed and the automation interface is OK.
2. excuted code
dim act as object
set act = getobject("c:\myfile.txt")
and got "not find file..." error.
I doubt it is doable to do OLE Automation with Notepad. I tried this, and it didn't work, but when I replaced it with a word document, it worked fine. Why do you want to do automation on a text file?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi MikeP,
So what is automation interface, how to know which object has got registed. I just want to learn getobjuct() and failed for both .txt and .doc. Can you help...or an example?
Cheers.
So what is automation interface, how to know which object has got registed. I just want to learn getobjuct() and failed for both .txt and .doc. Can you help...or an example?
Cheers.
I did set objObject = getobject("c:\windows\desk top\anthon y.doc") and it worked fine.. is MS Word on your machine?
ASKER
Hi Anthonyc,
Thank you for your two comments.
As you know now, I just want to learn getobject() since it is under Activex which looks like something new.
My PC hasn't got MS Word but when I click at the .doc file the Wodpad actived...As MikeP said that doesn't mean ole interface registered (Why not say "automation interface registered"?).
Cheers.
Thank you for your two comments.
As you know now, I just want to learn getobject() since it is under Activex which looks like something new.
My PC hasn't got MS Word but when I click at the .doc file the Wodpad actived...As MikeP said that doesn't mean ole interface registered (Why not say "automation interface registered"?).
Cheers.
Wordpad is not OLE automation compatible.. that's why it doesn't work.
ASKER
Hi Experts,
I have check the OLE automation by puting an OLE control into the form and looking at the property box. There are some classes included in the box: PBrush, Paint.Pecture and others. Hence, I quess those must be registed automation interfaces! So, I tried:
dim act as object
set act = createobject("Paint.Pictur e") 'or ("PBrush")
but still got error message: Object required:-(
I have check the OLE automation by puting an OLE control into the form and looking at the property box. There are some classes included in the box: PBrush, Paint.Pecture and others. Hence, I quess those must be registed automation interfaces! So, I tried:
dim act as object
set act = createobject("Paint.Pictur
but still got error message: Object required:-(