Insert text here-field (Macrobutton nomacro) dissapears after typi

R

Raziel014

Hi, I know that if I insert a Macrobutton NoMacro-field in Word, it allows
the user to click on it and just type. But I've seen other templates where
the user can do just that, but the fields isn't replaced by the typed text
afterwards.

How can I make sure the fields just stay there, even after the user has
typed something into it?
 
J

Jean-Guy Marcil

Raziel014 was telling us:
Raziel014 nous racontait que :
Hi, I know that if I insert a Macrobutton NoMacro-field in Word, it
allows the user to click on it and just type. But I've seen other
templates where the user can do just that, but the fields isn't
replaced by the typed text afterwards.

How can I make sure the fields just stay there, even after the user
has typed something into it?

What Word version?

In Word 2003 and previous versions, this can only be done with formfields in
a protected document.

For more on those, see:
http://www.mousetrax.com/techpage.html#autoforms
 
P

Pesach Shelnitz

Hi Raziel,

If I understood correctly what you want to do, there is another way. You can
have your macro button call a macro like the following.

Sub MyMacro()

Dim newText As String
Dim myField As Field

newText = InputBox("Type the new text for the field.")

Set myField = ActiveDocument.Fields.Add(Range:=Selection.Range, _
Type:=wdFieldEmpty, PreserveFormatting:=False)
myField.Code.Text = "MACROBUTTON MyMacro " & newText
myField.ShowCodes = False
End Sub
 
J

Jean-Guy Marcil

Pesach Shelnitz was telling us:
Pesach Shelnitz nous racontait que :
Hi Raziel,

If I understood correctly what you want to do, there is another way.
You can have your macro button call a macro like the following.

Sub MyMacro()

Dim newText As String
Dim myField As Field

newText = InputBox("Type the new text for the field.")

Set myField = ActiveDocument.Fields.Add(Range:=Selection.Range, _
Type:=wdFieldEmpty, PreserveFormatting:=False)
myField.Code.Text = "MACROBUTTON MyMacro " & newText
myField.ShowCodes = False
End Sub

Yes, this would preserve the field; however, I do not see how this meets the
OP requirement:

"
But I've seen other templates where
the user can do just that, but the fields
isn't replaced by the typed text
afterwards.
"

???

He is not talking about a pop up box or anything like that...
You type, and the field remains as you type.
Or did I miss something?
 
M

macropod

Hi folks,

One could use a FILLIN field, pre-filled with the prompt text. Such a field might be coded like:
{FILLIN " How old are you?" \d "Click here, then press F9 and type your answer"}
 
K

Kenny Bones

You are corrent. I most certainly don't want any popups or anything. Just
having the field stay there after it's been typed into again.
 
J

Jean-Guy Marcil

Kenny Bones was telling us:
Kenny Bones nous racontait que :
You are corrent. I most certainly don't want any popups or anything.
Just having the field stay there after it's been typed into again.

If you are not using a protected document, then you will have to use content
controls, which are only available from Word 2007 onward.
 
C

Cindy M.

Hi Kenny,
Just
having the field stay there after it's been typed into again.

Well, the one thing that occurs to me is to switch off "Typing
replaces selection" in the Word options? But that would retain
the field next to the new text. I can't tell if that's what you
mean.

If not, then I'm guessing the macro would have to recreate the
field around the text (setting the typed text as the prompt).
This, however, would not allow the text to break over to a new
line.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17
2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow
question or reply in the newsgroup and not by e-mail :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top