User Dialog Box triggering

  • 1
  • Question
  • Updated 6 days ago
I want to enter text from user dialog box into a Topic.

Ex: 

Sub Main
With ActiveDocument.Selection.PrimaryTopic .AddSubTopic("Text") End With  
End Sub

I can use the above to add a subtopic and add "Text" as text in the Topic. Instead, I want to trigger a user dialog box inside (.AddSubtopic) so that I can enter the text I want to. Any inputs are welcome. 


Thanks


Photo of gthghcdng

gthghcdng

  • 5 Posts
  • 0 Reply Likes

Posted 6 days ago

  • 1
Photo of Ary Velstra, Expert Trainer

Ary Velstra, Expert Trainer

  • 1381 Posts
  • 208 Reply Likes
Why use a macro for a standard function?
Could you not just touch the insert key and you get what you want?
Photo of Nick Duffill

Nick Duffill, Champion

  • 518 Posts
  • 173 Reply Likes
Try the VBScript InputBox function.  It will return an empty string if the user cancels.

Dim s_Input as string
s_Input = InputBox("Prompt...")
If Len(s_Input) > 0 Then .AddSubTopic(s_Input)

I would recommend some familiarity with VBScript before getting too far into the MindManager object model.

@Ary: I imagine that there will be a need to do more than just collect text input with the macro.

Photo of Ary Velstra, Expert Trainer

Ary Velstra, Expert Trainer

  • 1379 Posts
  • 208 Reply Likes
@Nick, I agree. Therefore I was hoping that the question is not isolated to just ONE subject but should focus on What he has in mind.
If you just answer this one, there maybe pop up a next within hours or days.
And If it is known what the ultimate goal is, the response can be easier and more exact.
Photo of gthghcdng

gthghcdng

  • 5 Posts
  • 0 Reply Likes
@Nick: Thanks for the input.

@Ary: As you guessed, I have more in my mind. All I wanted was some starter input where I can build on from it. Nick's reply serves my exact purpose.

Thank you both for the super fast reply. You are super nice to do this.