Solved

Automation Servers

Posted on 2000-02-16
5
197 Views
Last Modified: 2012-05-04
How does one determine the methods available from a given automation server interface.  For example many code examples have the following simple app:

var
  Word: Variant;
begin
  Word := CreateOleObject('Word.Basic');
  Word.FileNew('Normal');
  Word.Insert('This is the first line'#13);
  Word.Insert('This is the second line'#13);
  Word.FileSaveAs('c:\temp\test.txt', 3);

What I want to know is how do I determine that methods an automation server interface has ( eg Insert() ) in the example above? This is easy enough to do with ActiveX but Im at a loss with Automation Servers.  Then again I could have missed something basic.
0
Comment
Question by:twalsh
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 12

Expert Comment

by:rwilson032697
ID: 2530037
Listening
0
 
LVL 10

Expert Comment

by:Lischke
ID: 2530312
Hi,

I don't know if there's an simpler way but I usually look up the Wordbasic help from Word (in this case) to learn what method calls are allowed. For other automation servers a similar help should be available, otherwise nobody could write scripts for them.

Ciao, Mike
0
 
LVL 2

Accepted Solution

by:
florisb earned 50 total points
ID: 2530450
To do:

Not Wordbasic, but OLE / COM / Automation:

Select Project | Import Type Library | Microsoft Word (9.0?).... | create unit.

Now you have a unit with all possible methods you can call, you can find Insert here too.

now define a global:

FWord : _application

and add ComObj to your uses list.

so you can:

FWord := CoApplication.Create;
et cetera (see previous questions on this subject).

Trying to automate something? Do it in Word and record a macro; then translate the macro to Delphi by checking the imported unit.

Floris.


0
 

Author Comment

by:twalsh
ID: 2540737
Thankyou, I will follow up on this.  
0
 
LVL 2

Expert Comment

by:florisb
ID: 2541555
thanks, if you have more specific questions about Word...

Good luck,
Floris.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Suggested Courses
Course of the Month6 days, 11 hours left to enroll

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question