Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Mailmerge and Fax / May 2004

Tip: Looking for answers? Try searching our database.

Drop-down form fields

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
LynnR - 21 May 2004 16:52 GMT
Is there a way around the character limitation when using
a drop-down form field...I have a requirement for a drop-
down with long entries for each item.  Word cuts off the
type after about 25 characters.  Is there an easy way
programatically to create my own drop-down box....help is
appreciated.  Best regards
Charles Kenyon - 21 May 2004 20:01 GMT
You could call up an on-exit macro that (1) hides the drop-down field and
(2) uses the contents of the field to choose text to insert or display,
possibly from AutoText.

You could actually not hide the field but simply have it be the beginning of
your text and have the rest inserted at a bookmark following the field
depending on the contents of the field. You would be unprotecting and
reprotecting the form and inserting text  in a bookmark without deleting the
bookmark. These are both slightly tricky but there are code examples of both
available at the MVP FAQ site.

There is probably a better way but nothing occurs to me.
Signature


Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide

See also the MVP FAQ: http://www.mvps.org/word which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.

> Is there a way around the character limitation when using
> a drop-down form field...I have a requirement for a drop-
> down with long entries for each item.  Word cuts off the
> type after about 25 characters.  Is there an easy way
> programatically to create my own drop-down box....help is
> appreciated.  Best regards
LynnR - 21 May 2004 21:30 GMT
I experimented with creating the drop-down in vba and it
works without having to unprotect the document, except...
the Range:=Yadayada.Range (Start:=0, End:=0) puts the drop-
down list at the beginning of the page (see start,end) I
understand what and why the code is doing that, I just
don't have the know how to set the range (if range is
correct in this instance) as a bookmarked form field.

When I tab from a prior form field, using an "entry" macro
to the field where I really, really want the list to
appear, it instead appears at the top/left/start of the
form document and I understand the range command is
controlling that... I feel I can get this to work if I can
modify the code to see the book marked field being tabbed
into....any suggestions please...best regards (see sample
of the code below)

Sub Dropdown()
Set ffield = ActiveDocument.FormFields.Add( _
   Range:=ActiveDocument.Range(Start:=0, End:=0), _
   Type:=wdFieldFormDropDown)
With ffield
   .Name = "No1"
   With .Dropdown.ListEntries
   .Add Name:="Text1"
   .Add Name:="Text2"
   .Add Name:="Text3"
   End With
End With
>-----Original Message-----
>You could call up an on-exit macro that (1) hides the drop-down field and
[quoted text clipped - 17 lines]
>
>.
Charles Kenyon - 21 May 2004 21:38 GMT
You would be inserting text, not a field at a predetermined bookmark
location and you do need to unprotect the document to do that. You can
either have the text directly in your macro, or you can store it in
AutoText. My preference is to store it in AutoText because it makes the
macro much less bulky and AT is easier (for me) to edit than is text
embedded in a macro. That is, the first part of the information you want is
in the drop-down. That is used by the macro to decide what (if any) text is
to follow.

You probably could use the bookmark from the drop-down field for positioning
except that then your choice would be final. If you add a separate bookmark
following the field you can put your insertion inside the bookmark. If the
selection in the drop-down changes, that text can be replaced with the same
macro.
Signature


Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide

See also the MVP FAQ: http://www.mvps.org/word which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.

> I experimented with creating the drop-down in vba and it
> works without having to unprotect the document, except...
[quoted text clipped - 74 lines]
> >
> >.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.