WD: Using Program Manager DDE Interface in WordBasic Macros

Last reviewed: July 30, 1997
Article 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:

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


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


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: July 30, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.