WD: Using Program Manager DDE Interface in WordBasic Macros

ID: Q102395

The information in this article applies to:

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:

   ARTICLE-ID: Q72907
   TITLE     : Manipulating Program Manager Groups Using DDE Interface

Additional query words: win31
Keywords          : kbmacro kbdtacode winword word6 winword2 word7 word95 
Version           : 2.x 6.0 6.0a 6.0c 7.0 7.0a
Issue type        : kbinfo

Last Reviewed: March 27, 1998