• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 265
  • Last Modified:

How to print Word 6 files using Delphi 1 DDE?

How I can make Word 6 print a document from Delphi 1 application using DDE?
Where can I find Word 6 DDE macros?
  • 2
1 Solution
Is this what you're looking for?

ShellExecute(0, 'print', 'C:\windows\desktop\test.doc', nil, nil, SW_NORMAL);

Hope this helps..

You can do something like this (I'm not 100% sure of the syntax, as I'm on D4 now :-) :

With MyDDEClient Do
  If SetLink('Winword', '') Then

The WordBasic helpfile has a list of all available commands..
Also, take a look at this file: ftp://sunsite.icm.edu.pl/pub/delphi/d10free/wordapi.zip
shrlduAuthor Commented:
BlackMan, I knew it was something like that... But how it looks _exactly_? You missed the second parameter in Execute macro, WaitFlg. But even when I put it in the place the result was that string 'Print' was inserted into the Word document. And I don't know how to connect WordBasic syntax with Delphi one.

Victor, it works great, but it seems to be file extension-depended, isn't it? I wanted to have more control with DDE...

I have tested it only with DOC extensions, but I don't know if it is dependent... You might try and see if it works for other extensions also... Good Luck!

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

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.

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