Solved

Automation Servers

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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

757 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now