Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Report production when Using a GUI
Date: Mon, 1 Nov 2010 22:02:03 +0000 (UTC)
Organization: Sandia National Laboratories
Lines: 11
Message-ID: <iandcr$dvc$1@fred.mathworks.com>
References: <iamts0$5ht$1@fred.mathworks.com> <ian2rg$8uh$1@fred.mathworks.com> <ian3nh$7l4$1@fred.mathworks.com> <ian668$k7d$1@fred.mathworks.com> <ian8ud$kbo$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1288648923 14316 172.30.248.38 (1 Nov 2010 22:02:03 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 1 Nov 2010 22:02:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 210783
Xref: news.mathworks.com comp.soft-sys.matlab:683018

There are two good places to start:

1.  http://www.mathworks.com/help/techdoc/matlab_external/bqdwu3j.html
This is the Matlab documentation on how to interact with COM objects.  You can use Matlab's get() and set() functions, but you can also use syntax like Word_COM.Visible = 1 (more VBA-like syntax).  The only time I've run into problems is sometimes Office objects let you do things like object.Items("Name") to get the particular name of an object from a collection.  I've never found an analog in Matlab and always just end up looping through all items and finding a match.

2.  Documentation in the Word Developer Reference
All of the objects, methods, and parameters you use are defined by Word.  That's why the macro-editor is so handy.  If you need to do something from Matlab, just record a macro and then perform what is usually a trivial translation to Matlab.  Often no translation is needed at all.  You also need this reference to explain enumerations that the macro editor will use.

You might also looks at the methodsview() function in Matlab.  This is useful at times.  If you call methodsview(Word_COM) you'll see all the methods defined for that object.  In the Arguments list, the first argument is always "handle".  That's the object itself and does not need to be repeated explicitly in the argument list.  You can use get(Word_COM) to look at all of the parameters defined for the object as well.

-Eric