?
Solved

Automation Servers

Posted on 2000-02-16
5
Medium Priority
?
199 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 200 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
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

719 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