[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 655
  • Last Modified:

Start Macro in Word from Delphi

Hi,
how can I start a Macro in Word from Delphi?

Micha
0
PROGRAMMING030999
Asked:
PROGRAMMING030999
1 Solution
 
EpsylonCommented:
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
 
xsoftCommented:
listening
0
 
PROGRAMMING030999Author Commented:
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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now