Help with using a toggle button to insert text. RRS feed

  • Question

  • I really need help, I have never used VBA in Word and I am just trying to create a toggle button that when clicked will enter text into a box that can then be copied into another program. I have figured out how to create the button, I even figure out how to create a copy function for a command button.  However the ability to make the toggle button enter text is completely stumping me.  Please help as far as what I have so far well its sad:

    Private Sub ToggleButton1_Click()

    End Sub

    I have a total of 4 buttons now and I would like the text entry to be the label of the button itself.  So if I click the button labeled Mark, then Mark would be entered onto a list followed by "/" and then so on and so forth.  Thank you very much for taking the time to read this and I look forward to any help that can be provided.

    • Moved by Youen Zen Tuesday, July 24, 2012 6:09 AM Not VB issue (From:Visual Basic General)
    Monday, July 23, 2012 10:43 AM

All replies

  • Hello, if you are looking to do this in MS-Word rather than in Visual Studio I would suggest asking this question under the forum Word For Developers (unless a moderator moves this thread first).


    Monday, July 23, 2012 12:57 PM
  • HI trueswitcher

    1. For starters, we need to know the version of Word involved.

    2. I can make a pretty good guess what kind of button is involved, but Word does support more than one kind and the coding is different for each kind. So please tell us what kind of button(s) you're using. If you're unsure, tell us the commands in the user interface you use to insert them.

    3. Why would you want a toggle button to execute a straight-forward command? A toggle button is used to turn something "on/off".

    4. Please give us more details about the "box" into which text should be entered. Again, there are many things in Word that could be a "box" - we need to know exactly what kind.

    5. And please tell us more about where this text is coming from (the source of the text that should be put in the box).

    Cindy Meister, VSTO/Word MVP

    Wednesday, July 25, 2012 9:24 AM