• Macro Button – Multipe lines of Text

    Author
    Topic
    #476039

    Hi Loungers

    I havent been here for ages. I am back with a question regarding macro buttons. A user has a document that they wish to have prompters to tell users what is to be typed into a place within a document. Much like the [Click here to type name] you see on a letter or fax. I think a macro button is the way to go, however, I am limited to one line of text. Naturally they want several lines of instruction.

    Do you have any suggestions or work abouts for this issue, or can someone suggest another way to do this?

    Kerry

    Viewing 2 reply threads
    Author
    Replies
    • #1275733

      Hi Kerry,

      I can confirm that the macrobutton field’s display text cannot span more than one line. Of course, the problem with instructions of that kind (even if you could have a multi-line macrobutton field), is that they disappear as soon as you start typing. Tough if you want to review the instructions once you’ve started typing!

      However, if you really want to go down that path, you can use the macrobutton field to trigger a macro that deletes itself and the rest of the text in the paragraph it’s in (without deleting the paragraph itself). In the case, you might have the instructions, which finish with words like “When you’re finished reading these instructions Double-Click here to delete the instructions and start typing”, the macrobutton field incorporating just the words “Double-Click here”. The code to implement this follows:

      Code:
      Sub MyMacro()
      Dim Rng As Range
      Set Rng = Selection.Paragraphs.First.Range
      Rng.End = Rng.End - 1
      Rng.Text = vbNullString
      End Sub

      In this case, the macrobutton field would be coded as {MACROBUTTON MyMacro Double-Click here}

      Because of the way this works (by deleting the current paragraph’s contents), you could have multiple such macrobutton fields throughout the document is you want, all poiting to the same macro.

      Cheers,
      Paul Edstein
      [Fmr MS MVP - Word]

    • #1286275

      I haven’t tried it, but expect that you could put a textbox in the prompt area of the macrobutton field. These fields allow pictures so I can’t think of a reason why they wouldn’t allow a textbox. Since your user will be overtyping the field, the textbox will be deleted.

    • #1286326

      If you use a Text Form Field, you have unlimited length. However, you need to protect the document or that Section as a Form. And, of course, once you start typing, the instructions are gone forever from that document!

    Viewing 2 reply threads
    Reply To: Macro Button – Multipe lines of Text

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: