Solved

Start Macro in Word from Delphi

Posted on 2000-04-28
3
599 Views
Last Modified: 2010-04-04
Hi,
how can I start a Macro in Word from Delphi?

Micha
0
Comment
Question by:PROGRAMMING030999
3 Comments
 
LVL 13

Accepted Solution

by:
Epsylon earned 50 total points
ID: 2758884
Here's an example that does some things including running a macro:

var
  Word: OleVariant;
begin
  Word := CreateOleObject('Word.Application');
  Word.WordBasic.FileNew('Normal');
  Word.WordBasic.Insert('This is the first line'#13);
  Word.WordBasic.Insert('This is the second line'#13);
  Word.Run('Macro1');
  Word.WordBasic.FileSaveAs('test.doc');
  Word.WordBasic.FileClose;
end;


Regards,

Epsylon.
0
 
LVL 1

Expert Comment

by:xsoft
ID: 2767591
listening
0
 

Author Comment

by:PROGRAMMING030999
ID: 2768962
Thanks Epsylon for your answer,
I found i nice site about it:

http://www.djpate.freeserve.co.uk/WordPrbs.htm

Cheers Micha


0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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…
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…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Edureka is one of the fastest growing and most effective online learning sites.  We are here to help you succeed.

911 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

21 Experts available now in Live!

Get 1:1 Help Now