Article ID: 123443
Article Last Modified on 10/11/2006
Creates a new group at Program Manager or activates the window of an existing group.
Deletes an existing program group.
Creates a new program item (icon) in the IconIndex,xPos,yPos, active group. DefDir,HotKey,,fMinimize)
Maximizes, minimizes, or restores a group window.
Sub CreateGroup()
Dim Chan As Integer
Chan = DDEInitiate("Progman", "progman")
DDEExecute Chan, "[CreateGroup(Excel Files)]"
' Terminate channel
DDETerminate Chan
End Sub
Sub DeleteGroup()
Dim Chan As Integer
Chan = DDEInitiate("Progman", "progman")
DDEExecute Chan, "[DeleteGroup(Excel Files)]"
' Terminate channel
DDETerminate Chan
End Sub
Sub AddItem()
Dim qt As String
Dim Chan As Integer
Dim path As String, item As String
' Set qt equal to quotation mark character
qt = Chr(34)
Chan = DDEInitiate("Progman", "progman")
path = InputBox("Enter path for item")
item = InputBox("Enter name for item")
DDEExecute Chan, _
"[AddItem(" & qt & path & qt & "," & qt & item & qt & ")]"
' Terminate channel
DDETerminate Chan
End Sub
Sub GroupWindow()
Dim Chan As Integer
Chan = DDEInitiate("Progman", "progman")
' Maximize Excel Files group
DDEExecute Chan, "[ShowGroup(Excel Files,3)]"
' Minimize Excel Files group
DDEExecute Chan, "[ShowGroup(Excel Files,2)]"
' Restore Excel Files group
DDEExecute Chan, "[ShowGroup(Excel Files,1)]"
' Terminate channel
DDETerminate Chan
End Sub
Dim Chan as Integer
Dim listing as Variant
Dim i as Integer
Sub ListGroups
Chan = DDEInitiate("Progman","Progman")
listing = DDERequest(Chan,"Progman")
' Terminate channel
DDETerminate Chan
i=1
While i <= UBound(listing)
Sheets("sheet1").Cells(i,1).FormulaR1C1=listing(i,1)
i=i+1
Wend
End Sub
Microsoft provides examples of Visual Basic for Applications procedures for
illustration only, without warranty either expressed or implied, including,
but not limited to the implied warranties of merchantability and/or fitness
for a particular purpose. The Visual Basic procedures in this article are
provided 'as is' and Microsoft does not guarantee that they can be used in
all situations. While Microsoft support professionals can help explain the
functionality of a particular macro, they will not modify these examples to
provide added functionality, nor will they help you construct macros to
meet your specific needs. If you have limited programming experience, you
may want to consult one of the Microsoft Solution Providers. Solution
Providers offer a wide range of fee-based services, including creating
custom macros. For more information about Microsoft Solution Providers,
call Microsoft Customer Information Service at (800) 426-9400.
72907 Manipulating Program Manager Groups Using DDE Interface
DDE: channels
Additional query words: 5.00c howto vbappcode XL5
Keywords: kbenv kbinterop kbprogramming KB123443