WD: Using Program Manager DDE Interface in WordBasic Macros

ID: Q102395


The information in this article applies to:
  • Microsoft Word for Windows, versions 2.0, 2.0a, 2.0a-CD, 2.0b, 2.0c, 6.0, 6.0a, 6.0c
  • Microsoft Word for Windows 95, versions 7.0, 7.0a


SUMMARY

Windows Program Manager features a DDE interface you can use from within a Word for Windows WordBasic macro to control certain activities in Program Manager.

The following list contains the Program Manager DDE commands you can use in your WordBasic macros.

Word 7.x

CreateGroup()

   ChanNum = DDEInitiate("ProgMan", "Progman")
   rem CreateGroup(GroupName,GroupPath)
   DDEExecute ChanNum, "[CreateGroup(WinWord Docs)]"
   DDETerminate ChanNum 
ShowGroup()
Instructs the Program Manager to maximize, minimize, or restore a group window.

   ChanNum = DDEInitiate("ProgMan", "Progman")
   rem ShowGroup(GroupName,ShowCommand)
   DDEExecute ChanNum, "[ShowGroup(WinWord Docs,3)]"
   DDETerminate ChanNum 
DeleteGroup()
Instructs the Program Manager to delete a group.

   ChanNum = DDEInitiate("ProgMan", "Progman")
   rem DeleteGroup(GroupName)
   DDEExecute ChanNum, "[DeleteGroup(WinWord Docs)]"
   DDETerminate ChanNum 

Word 2.x, 6.x

CreateGroup()
Instructs the Program Manager to create a new group or activate the window of an existing group.

   ChanNum = DDEInitiate("ProgMan", "Progman")
   rem CreateGroup(GroupName,GroupPath)
   DDEExecute ChanNum, "[CreateGroup(WinWord Docs)]"
   DDETerminate ChanNum 
ShowGroup()
Instructs the Program Manager to maximize, minimize, or restore a group window.

   ChanNum = DDEInitiate("ProgMan", "Progman")
   rem ShowGroup(GroupName,ShowCommand)
   DDEExecute ChanNum, "[ShowGroup(WinWord Docs,3)]"
   DDETerminate ChanNum 
AddItem()
Instructs the Program Manager to create a new program item (icon) in the currently active group window.

   ChanNum = DDEInitiate("ProgMan", "Progman")
   rem (Windows 3.0) AddItem(CommandLine,
   rem Name,IconPath,IconIndex,xPos,yPos)
   rem (Windows 3.1) AddItem(CmdLine,Name,IconPath,IconIndex,xPos,
   rem yPos,DefDir,HotKey,,fMinimize)
   DDEExecute ChanNum, "[AddItem(" + Chr$(34) + "Winword.Exe " +\ 
   Chr$(34) + "," + Chr$(34) + "Word" + Chr$(34) + ")]"
   DDETerminate ChanNum 
DeleteGroup()
Instructs the Program Manager to delete a group.

   ChanNum = DDEInitiate("ProgMan", "Progman")
   rem DeleteGroup(GroupName)
   DDEExecute ChanNum, "[DeleteGroup(WinWord Docs)]"
   DDETerminate ChanNum 
For additional information, please see the following article in the Microsoft Knowledge Base:
Q72907 Manipulating Program Manager Groups Using DDE Interface

Additional query words: win31

Keywords : kbmacro kbdtacode winword word6 winword2 word7 word95
Version : WINDOWS:2.0,2.0a,2.0a-CD,2.0b,2.0c,6.0,6.0a,6.0c,7.0,7.0a
Platform : WINDOWS
Issue type : kbinfo


Last Reviewed: December 22, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.