Ao full intray projects.mmbas

From ActivityOwnerWiki
Jump to: navigation, search
'ao_full_intray_projects 21Aug07
'run on sweep and review dashboard to enumerate projects with full in-trays
Option Explicit
Sub Main
Dim d As Topic
Dim c As Topic
Dim t As Topic
Dim a As Topic
Set c=ActiveDocument.CentralTopic
Set d=c.AddSubTopic("Projects with In-tray Items")
For Each t In c.AllSubTopics
  If t.Text="My In-tray Activities for processing" Then
		For Each a In t.AllSubTopics
			createtopic(d, a.CalloutTopics(True).Item(1))
  End If
End Sub
Function createtopic(parent As Topic,newtopic As Topic)
	Dim stopic As Topic
	Dim found As Boolean
	For Each stopic In parent.AllSubTopics
		If stopic.Hyperlink.Address=newtopic.Hyperlink.Address Then
			Set createtopic=stopic
		End If
	If Not found Then
		Set createtopic = parent.AddSubTopic("")
		createtopic.Xml = newtopic.Xml
	End If
End Function