Rnd code

From ActivityOwnerWiki
Jump to: navigation, search
{run:macro:'found=False%0D%0A    For Each mtopic In ActiveDocument.CentralTopic.AllSubTopics%0D%0A    	If LCase(mtopic.Text)=LCase(%22My committed Next actions towards success%22) Then%0D%0A    		found=True%0D%0A    		Set ntopic=mtopic%0D%0A    	End If%0D%0A    Next%0D%0A    If found Then%0D%0A    		pick=Round((ntopic.AllSubTopics.Count-1)*Rnd)+1%0D%0A    		Set ctopic=ntopic.AllSubTopics(pick)%0D%0A    		pick=Round((ctopic.AllSubTopics.Count-1)*Rnd)+1%0D%0A    		Set ptopic=ctopic.AllSubTopics(pick)%0D%0A    		ActiveDocument.Selection.Set(ptopic)%0D%0A    		ptopic.Show%0D%0A    		MsgBox(ptopic.Text,vbOnly,%22YOU NEED TO...%22)%0D%0A	Else%0D%0A		MsgBox(%22Please open your daily actions dashboard%22)%0D%0A	End If'}