Solved

How to print Word 6 files using Delphi 1 DDE?

Posted on 1998-12-20
4
242 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

763 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

12 Experts available now in Live!

Get 1:1 Help Now