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
Solved

How to print Word 6 files using Delphi 1 DDE?

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Printing problem 2 101
Controlled Assessment GCSE - desperate help needed 4 101
Find and Replace Stream with 0s 8 69
FMX TEdit KeyUp handler detecting  "enter" key 4 13
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
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…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

809 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