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 / Programming / December 2007

Tip: Looking for answers? Try searching our database.

UserForms to Populate FormFields

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jeff - 29 Nov 2007 15:03 GMT
I would like to use UserForms to Populate formfields rather then bookmarks is
ths Possible? or is there a way for the bookmaks to hold a specific section
of a document without disturbing  the rest?

With ActiveDocument
   .Bookmarks("tklarm1").Range _
   .InsertBefore TextBox1
   .Bookmarks("tklarm2").Range _
   .InsertBefore TextBox2
End With

UserForm14.Hide
David Sisson - 29 Nov 2007 16:10 GMT
Yes, you can, but you will not gain any advantage with document flow
as the text will flow just like a bookmark, and, in addition, you'll
have to protect the document, or at least the section the formfield is
in.

Usually, the way I control document flow, is with tables.

Could you elaborate a little on what you're trying to prevent?
fumei - 29 Nov 2007 17:56 GMT
David is quite correct.  Text going into a bookmark, is just that...text.  It
will flow normally.

Formfields, yes, it is true you can - to a certain extent - use as structural
elements in text flow, but they can have their own issues.

Tables are indeed useful to handle some text flow issues.

I would go along with David and ask, what - exactly - is the issue?  What are
you trying to either prevent, or perhaps, even cause?

>Yes, you can, but you will not gain any advantage with document flow
>as the text will flow just like a bookmark, and, in addition, you'll
[quoted text clipped - 4 lines]
>
>Could you elaborate a little on what you're trying to prevent?
fumei - 29 Nov 2007 18:00 GMT
Sorry, but actually answer your question.

Yes.

Userforms can put content into formfields very easily.  Simply use the .
Result property of the formfield.

On userform:  a control Textbox1
In document:  text formfield named "Yadda"

In userform code:

ActiveDocument.Formfields("Yadda").Result = Textbox1.Text

Viola.  The formfield "Yadda" will be Textbox1.Text

If you indtend to make lots of formfields, I would make a formfield object,
and a collection of them.
Jeff - 03 Dec 2007 22:59 GMT
I have a document with text I want to remain constant. I need the constant
text not to move when the bookmarks are populated. I have limited knowlede
using VBA so code snippets would be very much apprecatied. I will try using
tables to prevent this while waiting for a response. Thanks for the help.

> Yes, you can, but you will not gain any advantage with document flow
> as the text will flow just like a bookmark, and, in addition, you'll
[quoted text clipped - 4 lines]
>
> Could you elaborate a little on what you're trying to prevent?
Doug Robbins - Word MVP - 04 Dec 2007 00:01 GMT
The usual way to stop things moving is to use a table with fixed cell
dimensions.

Signature

Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

>I have a document with text I want to remain constant. I need the constant
> text not to move when the bookmarks are populated. I have limited knowlede
[quoted text clipped - 10 lines]
>>
>> Could you elaborate a little on what you're trying to prevent?
 
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.