Reply
 
Thread Tools Display Modes
  #1   Report Post  
La La Lara
 
Posts: n/a
Default Add a new page in a form by using a macro???

I have a form which is currently one page long. I have put the form fields
in tables and limited the number of characters in the form fields so that the
formatting of the form will not be changed when too much text is entered.

However, a user may at times need to enter more text than the field allows.
Is there a ??macro?? that can be invoked when the field is "full" that will
insert a new page with an unlimited form field?
  #2   Report Post  
Jean-Guy Marcil
 
Posts: n/a
Default

La La Lara was telling us:
La La Lara nous racontait que :

I have a form which is currently one page long. I have put the form
fields in tables and limited the number of characters in the form
fields so that the formatting of the form will not be changed when
too much text is entered.

However, a user may at times need to enter more text than the field
allows. Is there a ??macro?? that can be invoked when the field is
"full" that will insert a new page with an unlimited form field?


I don't thnik you can do that easilyt in an automatic manner. However, it is
fairly ewasy this way:

Add a MACROBUTTON field under the field that could continue on the next
page:
{MACROBUTTON AddPage Double-click here to add a page}
(Do CTRL-F9 to add the curly braces {}, then type the text in between as
shown here.
Select the field and do SHIFT-F9 to hide the code and display the message.

Protect the foirm.

Add the following macro in a standard module:
'_______________________________________
Sub AddPage()

Dim MyRange As Range

Set MyRange = ActiveDocument.Range

ActiveDocument.Unprotect "MyPassword"

With MyRange
.Collapse wdCollapseEnd
.InsertBreak wdPageBreak
.Collapse wdCollapseEnd
.FormFields.Add Range:=MyRange, Type:= _
wdFieldFormTextInput
.Select
End With

ActiveDocument.Protect wdAllowOnlyFormFields, _
True, "MyPassword"

End Sub
'_______________________________________

That's it!

If your form is not protected by a password, change


ActiveDocument.Unprotect "MyPassword"
and
ActiveDocument.Protect wdAllowOnlyFormFields, _
True, "MyPassword"
to
ActiveDocument.Unprotect
and
ActiveDocument.Protect wdAllowOnlyFormFields, _
True
--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
ISTOO
Word MVP site:
http://www.word.mvps.org



Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
macro for unprotecting form, update TOC, then reprotect form?? linda Microsoft Word Help 1 December 15th 04 02:31 PM
Need help "fooling" Word with Page Numbering jdkelley Microsoft Word Help 1 December 13th 04 10:26 PM
macro for updating TOC page numbers linda Microsoft Word Help 1 December 13th 04 04:22 PM
How do I get the full page label form to display? prober12 Microsoft Word Help 1 November 30th 04 09:29 PM
How to set a macro to insert a second page into a template A. Richardson Microsoft Word Help 5 November 30th 04 10:31 AM


All times are GMT +1. The time now is 05:22 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"