PDA

View Full Version : [SOLVED:] Working with Mailmerge Fillin boxes



Roderick
07-05-2018, 04:25 AM
I'm using Word 2013 and 2016 in separate Windows 10 machines.

I'm adding a Fillin field using this code:

ActiveDocument.MailMerge.Fields.AddFillIn Range:=Selection.Range, _
Prompt:="Title for the Appendix?", DefaultFillInText:="Type Appendix title here.", AskOnce:=True


On running the procedure it gives me this result:
22524

Can someone tell me, please, if there is a way to:


Remove the Cancel button
Prevent the user from pressing Enter and creating a blank line after they've typed the details within the box?


Why? I'm just trying to modify how people might use the form and prevent things going haywire.

Thanks for any help.

macropod
07-05-2018, 04:11 PM
Why are you adding the FILLIN field via code instead of having it in the mailmerge main document to start with? Moreover, you cannot modify the FILLIN field's prompt to work the way you want. If there is something you need to do programmatically, consider using an Input Box instead and testing the validity of the input/response.

Roderick
07-07-2018, 08:02 AM
Thanks, Paul, for your comments. Now I know one cannot change the FILLIN field's prompts.

Good point about your suggestion about using an Input Box.

Thanks.

Roderick