Solved

How to print Word 6 files using Delphi 1 DDE?

Posted on 1998-12-20
4
256 Views
Last Modified: 2010-04-04
How I can make Word 6 print a document from Delphi 1 application using DDE?
Where can I find Word 6 DDE macros?
0
Comment
Question by:shrldu
[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
  • 2
4 Comments
 
LVL 10

Expert Comment

by:viktornet
ID: 1352244
Is this what you're looking for?

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

Hope this helps..

—Viktor
——Ivanov
0
 
LVL 7

Accepted Solution

by:
BlackMan earned 100 total points
ID: 1352245
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
    ExecuteMacro('Print');

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
0
 

Author Comment

by:shrldu
ID: 1352246
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...

Thanks
0
 
LVL 10

Expert Comment

by:viktornet
ID: 1352247
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!

-Viktor
--Ivanov
0

Featured Post

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

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…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

759 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