how to findout properties and methods of MS Office objects in VB

hemasai
hemasai used Ask the Experts™
on
As we know we can open MS office files(powerpoint, excel etc) in a Visual basic application by creating an object
like CreateObject("Powerpoint.Application").

I would like to know all the properties and methods
of Powerpoint, Excel, Word objects created in Visual Basic.

In this case Visual Basic does not show us all the methods
and properties as it shows for other controls.
adn also MSDN didnot document all the properties and methods of objects mentioned above.

I request help in getting the same.

Thanks & Regards
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Author

Commented:
waiting for an early response

Commented:
One possible way of checking the different methods will be to use object browser from visual basic..

For example.. if you want to view the different properties and method under say Excel object..

Open visual basic.. project > References

In the list select the Microsoft Excel Object library..

Then View > Object browser ..select the Excel library from the drop down.. I think by default its going to list for all libraries associated to project.. so you can try selecting Excel library only.

Let us know how you are going on..

Good Luck
Two possibilities here.  If you press F2 while you have references to these objects in the VB environment, and right click in the right pane and select Show Hidden Members, you will see everything exposed by these.  You can then select the object you want to inspect from the top dropdown to see all its props, methods, events and they have hyper-jumps too.

The alternative is to open the OLE Viewer, then find the DLL/OCX/TLB, etc you are looking for and view it in IDL/ODL.

Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Commented:
The intelisense should tell you everything you need to know as you are coding.

Reference the Word object lib then declare your object like...

Dim doc As Word.Document

This will use word's type libs to give you intelli sense.
Top Expert 2006

Commented:
Hello Hemasai,
open the office application you need, hit alt+f11 and then F2 for the object browser, big plus is you got F1 with all the help on the objects+properties+methods
HAGD:O)Bruintje
WoodyUK,

<The intelisense should tell you everything you need to know as you are coding.>  This isn't entirely accurate.  In VB, you can only access the Hidden Members of an object by either knowing them or going into Object Browser and selecting "Show Hidden Members".  Then Intellisense will pick up hidden members.  There's a lot more out there that objects expose than intellisense picks up wihout showing the hidden members.


Commented:
Truly pointed out by Twalgrave.. not appropriate to use intellisense..

Commented:
True enough it will not show you hidden members - nor will it show you events.

I have interpreted the question as having a late/early binding theme.
I'm not sure if I got my point across (I am equally as unsure if I did) so here goes.  Sorry if it appears redundant, but in the interest of learning, I find it important.  Intellisense by default will not show the hidden members.  To get it to show those hidden members, you can go to the object browser and dispay the hidden members as described.  When you close out of the Object browser, Intellisense can now pick up the hidden members.

Author

Commented:
Dear All,

Thank You very much for a wonderful discussion.

Finally with the last comment of Twalgrave my doubts are clarified. Got a good point that Intellisense picks up the hidden members only when we enable it from Object Browser window and then use intellisense.

Thanking you all once again.

Author

Commented:

Dear twalgrave,

Thank you very much for a fine clarification

Regards
Hemasai.
You bet.  I like to share the tricks of the trade.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial