Sign in to follow this  
Followers 0
NeoWats

Microsoft COM Info

3 posts in this topic

Work needs me more and more to tie Autoit into interacting with Microsoft products. Is there a good resource that has the properities of Microsoft COM objects.(Excel and Word especially).

Thanks for any help.

Share this post


Link to post
Share on other sites



You have several options:

Use MS OLE Viewer or iTripoli's Type Library Viewer to view COM object info. You can google for those tools, I personally prefer iTripoli's viewer. Simply browse for registered COM components that the system presents or specify a particular DLL (or type library *.tlb file) to view COM object of interest. With Office/Word/Excel installed, they should show up in the registered COM component list as some relevant type library name. This option applies to all COM objects, even non-MS ones.

You could also use the object browser that is part of the MS Script Editor that is included with MS Word/Excel/Office. Simply open/edit/create a macro to start up the Script Editor, and from there navigate (via menu/toolbar) to the object browser. It should give you a list of Word/Excel object methods and properties you can work with. This is my preferred choice when working with MS Word/Excel/Office using COM, and this option only applies (I think) to MS Office COM objects.

Also on a side note, if you're going to interact AutoIt w/ other COM objects, you have 2 choices: Call COM objects from AutoIt, or use VBScript to access AutoIt functions via AutoItX and use VBScript to call COM objects, interacting the two together in VBScript. Personally, I prefer the latter method in this case, unless there is something specific you need from AutoIt that is not available via AutoItX (such as GUI control creation, AutoIt third-party code/library, etc.), because VBScript (or better yet, JScript) has better COM support. And JScript has even better COM exception handling than VBScript using try/catch. Can't say for the AutoIt scripting language, but VBScript can fail to detect Word COM exceptions and ends up either crashing or just not catching the error and continuing on with the rest of the code. If you find that too happens with AutoIt, you may want to switch to JScript + AutoItX + other COM.

Share this post


Link to post
Share on other sites

Good advice above, but for application-specific documentation, Google "msdn office object model"

Dale


Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0