Link to home
Start Free TrialLog in
Avatar of learn
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.
Avatar of anthonyc
anthonyc

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
Avatar of MikeP090797
MikeP090797

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of learn

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.
I did set objObject = getobject("c:\windows\desktop\anthony.doc") and it worked fine.. is MS Word on your machine?
Avatar of learn

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.
Wordpad is not OLE automation compatible.. that's why it doesn't work.  

Avatar of learn

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.Picture")  'or ("PBrush")
but still got error message: Object required:-(