Automation Servers

Posted on 2000-02-16
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:

  Word: Variant;
  Word := CreateOleObject('Word.Basic');
  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.
Question by:twalsh
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
LVL 12

Expert Comment

ID: 2530037
LVL 10

Expert Comment

ID: 2530312

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

Accepted Solution

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.



Author Comment

ID: 2540737
Thankyou, I will follow up on this.  

Expert Comment

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

Good luck,

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Suggested Solutions

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

752 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