Solved

How to print Word 6 files using Delphi 1 DDE?

Posted on 1998-12-20
4
251 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
  • 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

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

Suggested Solutions

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
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…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

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

24 Experts available now in Live!

Get 1:1 Help Now