WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

DDE

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

How to Use Pagemaker with DDE and WinBatch

Keywords:	Pagemaker DDE

Question:

Do you have any examples of how to use PageMaker with DDE?

Answer:

Here's an example from one of our users:

The pagemakerDDE script (below) is a general script showing how to use both commands and queries with PageMaker.

Since PageMaker commands can require quotes around some parameters, script 3 furnishes a working solution that seems clean.

I started this because PageMaker defaulted on File Open to that miserable My Documents folder on C. My data is on D and might be in one of several folders. So, I worked up this wbt that asks for a file, puts it into a command line and ships it via DDE into PageMaker. If PM isn't running, it first launches it. Works slick.

If an application is not set up for DDE, you will get 3140 string failure error messages.

To set up an application:

  1. Start Explorer and find the View Options menu item.

  2. Click the file type tab. Look for the application file type.

  3. Select the file type and click the Edit button.

  4. Now select the "open" in the actions window. Click another Edit button. Now you will see a dialog with a Use DDE check box at the bottom. Check it.

  5. More data entry boxes will appear. Enter just the application name in the application box--no quotes-- get this from the application documentation. Excel is Excel, PageMaker is PageMaker, but this can vary with the application. Now, put system, just that word without quotes, into the Topic box. Now close all the dialogs.

  6. DDE should now work.
:subpm ; optional label
; Use it if you use sub routines, a nice way to manage larger scripts.

;Note:
; PageMaker must be set up to recognize DDE commands. If it is not 
; ready for DDE, you will get 3140 string failure error messages.

; Setting up PageMaker for DDE
; Start Explorer and find the View Options menu item.
; Click the file type tab. Look for Pagemaker documents, probably 
; PageMaker 6.0 documents, or similar. Select the file type and click
; the Edit button. Now select the "open" in the actions window. 
; click another Edit button. Now you will see a dialog with a Use DDE
; check box at the bottom. Check it. More data entry boxes will appear.
; Enter just PageMaker, no quotes, in the Application box.  Put system, 
; just that word without quotes, into the Topic box. Now close all the 
; dialogs. DDE should now work nicely.
 
If !WinExist("~PageMaker")
    Run( "C:\Program Files\Adobe\Pagemaker60\PM6.EXE", "")
EndIf
WinActivate("~PageMaker")
    
    channel = DDEInitiate("PageMaker", "system")   ;Open a DDE link
    DDEExecute(channel, "new 1") ;Send a script command
    result = DDERequest(channel, "getpages") ;send a script query
    ;Message("PageMaker Results",result)
    DDETerminate( channel) ;Close the DDE link

Return	; Used if this section was called as a sub routine.
Exit
Or, alternatively, to open the Pagemaker file and do DDE:
:subpm ; optional label
   ; Use it if you use sub routines, a nice way to manage larger scripts.
;Note
; PageMaker must be set up to recognize DDE commands. If it is not 
; ready for DDE, you will get 3140 string failure error messages.

; Setting up PageMaker for DDE
; Start Explorer and find the View Options menu item.
; Click the file type tab. Look for Pagemaker documents, probably 
; PageMaker 6.0 documents, or similar. Select the file type and click
; the Edit button. Now select the "open" in the actions window. 
; click another Edit button. Now you will see a dialog with a Use DDE
; check box at the bottom. Check it. More data entry boxes will appear.
; Enter just PageMaker, no quotes, in the Application box.  Put system, 
; just that word without quotes, into the Topic box. Now close all the 
; dialogs. DDE should now work nicely.

filename = AskFileName( "Open PageMaker file", "d:\office forms", "PageMaker|*.pm6;*.pt6", "", 1 )
;pm script command is Open "filename",0|1 ;where 0 is original, 1 is copy
pmcommand = 'Open "%filename%",0'


If !WinExist("~PageMaker")
    Run( "C:\Program Files\Adobe\Pagemaker60\PM6.EXE", "")
EndIf
WinActivate("~PageMaker")
    
    channel = DDEInitiate("PageMaker", "system")   ;Open a DDE link
    DDEExecute(channel,'%pmcommand%') ;Send a script command
    ;result = DDERequest(channel, "getpages") ;send a script query
    ;Message("PageMaker Results",result)
    DDETerminate( channel) ;Close the DDE link

Return	; Used if this section was called as a sub routine.
Exit

Article ID:   W12823
Filename:   Use PageMaker with DDE.txt
File Created: 1999:04:15:16:49:52
Last Updated: 1999:04:15:16:49:52