Results 1 to 5 of 5
  1. #1
    4 Star Lounger
    Join Date
    Apr 2002
    Location
    Northern Territory, Australia
    Posts
    471
    Thanks
    16
    Thanked 0 Times in 0 Posts

    Red face Macro Button - Multipe lines of Text

    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

  2. #2
    Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    5,055
    Thanks
    2
    Thanked 417 Times in 346 Posts
    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.
    Last edited by macropod; 2011-04-14 at 04:11.
    Cheers,

    Paul Edstein
    [MS MVP - Word]

  3. The Following User Says Thank You to macropod For This Useful Post:

    kerryg (2011-04-14)

  4. #3
    4 Star Lounger
    Join Date
    Apr 2002
    Location
    Northern Territory, Australia
    Posts
    471
    Thanks
    16
    Thanked 0 Times in 0 Posts
    Great idea thanks!

  5. #4
    Silver Lounger Charles Kenyon's Avatar
    Join Date
    Jan 2001
    Location
    Sun Prairie, Wisconsin, Wisconsin, USA
    Posts
    2,049
    Thanks
    124
    Thanked 119 Times in 116 Posts
    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.

  6. #5
    4 Star Lounger
    Join Date
    Jan 2010
    Location
    Chichester, UK
    Posts
    401
    Thanks
    1
    Thanked 10 Times in 9 Posts
    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!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •