'===================================================================================
'Function Name :ExpandAllMenusFor Notepad' Created By :Jai
' Description : Expand all menuitems in the Notepad
' Created : Oct-16- 08
'===================================================================================
Function ExpandAllMenus()
Window("regexpwndtitle:= Notepad").Activate
With Window("regexpwndtitle:= Notepad").WinMenu("Menuobjtype:= 2")
nTopMenuCount = .GetItemProperty("", "SubMenuCount")
For i = 1 To nTopMenuCount
sTopItemPath = .BuildMenuPath("", i)
sTopItemLabel = .GetItemProperty(sTopItemPath, "Label")
sReport = sReport + sTopItemLabel + vbNewLine
bHasSubMenu = .GetItemProperty(sTopItemPath, "HasSubMenu")
If bHasSubMenu Then
nSubItemsCount = .GetItemProperty(sTopItemPath, "SubMenuCount")
For j = 1 To nSubItemsCount
sSubItemPath = .BuildMenuPath(sTopItemPath, j)
sSubMenuLabel = .GetItemProperty(sSubItemPath, "Label")
sReport = sReport + " * "+vbNewLine + sSubMenuLabel + vbNewLine
Next
End If
Next
End With
Reporter.ReportEvent micDone, "Menu Data", sReport
End Function
'===================================================================================
Comments