Ao new project map.mmbas

From ActivityOwnerWiki
Jump to: navigation, search
'ao_new_project_map.mmbas
'http://activityowner.com
'Copyright: http://creativecommons.org/licenses/by-nc-nd/3.0/
'17Jan2010
'17Jan2010-2 - fix next action selection
'30Jan2010 - avoid prompt to save with markup in filename
'30Apr2010 - add yellow boundary to in-tray
'
'#uses "ao_mindreader_common.mmbas"
'#uses "ao_common.mmbas"
Option Explicit
Sub Main
	Dim NewMap As Document
	Dim ConfigDoc As Document
	Dim DestinationBranch As Topic
	Dim KeywordTopic As Topic
	Dim DestinationKeyword As String
	Dim t As Topic
	Set NewMap = Documents.Add
	If Len(Command)>0 Then
		NewMap.CentralTopic.Text=Command & "[isproject]"
	Else
		NewMap.CentralTopic.Text=InputBox("What is the successful outcome for this project?") & "[isproject]"
	End If
	NewMap.Selection.Set(NewMap.CentralTopic)
	mindreaderNLP("")
	'add in-tray branch
	Set t=NewMap.CentralTopic.AddSubTopic("In-tray [isresult]")
	t.Task.Categories="Process,In-tray*"
	t.CreateBoundary.FillColor.Value=-96
	NewMap.Selection.Set(NewMap.CentralTopic.AllSubTopics(1))
	mindreaderNLP("")
	'add reference branch
	NewMap.CentralTopic.AddSubTopic("Reference").Icons.AddStockIcon(mmStockIconNoEntry)
	'add plan branch
	NewMap.Selection.Set(NewMap.CentralTopic.AddBalancedSubTopic("Plan").AddSubTopic(InputBox("What is the next action? Use 1st>>2nd>>3rd to define a sequence of tasks.")))
	MindReaderNLP("")
	'add destination keyword
	If MsgBox("Would you like to add a destination keyword pointing to this map's in-tray? Only do this if you anticipate adding many items to map from OutLinker or GyroQ",vbYesNo)=vbYes Then
		DestinationKeyword= InputBox("Enter Destination Keyword")
		If Len(DestinationKeyword)>0 Then
		        Set ConfigDoc=OpenMapHidden(MindReaderConfigMapFullName)
			Set DestinationBranch=createmainbranch("Links",ConfigDoc)
			Set KeywordTopic = DestinationBranch.AddSubTopic(DestinationKeyword)
			KeywordTopic.CreateHyperlink(LinkToThisTopic(NewMap.CentralTopic.AllSubTopics(1)))
			MsgBox("Destination Keyword sucessfully added to MindReaderConfig.  Make sure you review destination keywords in mindreaderconfig.mmap frequently and remove outdated keywords)")
		End If
	End If
	Set NewMap=Nothing
	Set DestinationBranch =Nothing
	Set ConfigDoc=Nothing
End Sub
End Sub