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 / January 2005

Tip: Looking for answers? Try searching our database.

Userforms: updating References

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
lindie - 15 Jan 2005 10:44 GMT
I am very proud having put together my first Userform thanks to
tutorials on the MVP site

This is my code   for my ResidentsInfo  form

Sub OK_Click()
'if user clicks OK the entered text is sent to the main form fields'
bookmarks

'sets variables for each Txtbox on entry form vOfffirstName =
ResidentsInfo.TxtOffFirstName.Text
vOffSurName = ResidentsInfo.TxtOffSurName.Text vDOA =
ResidentsInfo.TxtDOA.Text vDOB = ResidentsInfo.TxtDOB.Text

'Goes to each fields on form and serts results to variables
ActiveDocument.FormFields("OfffirstName").Result = vOfffirstName
ActiveDocument.FormFields("OffSurName").Result = vOffSurName
ActiveDocument.FormFields("DOA").Result = vDOA
ActiveDocument.FormFields("DOB").Result = vDOB

'get form off screen
ResidentsInfo.Hide

End Sub

1.  When clicking on the OK  box I want to update all the REF in the
document automatically. I have found all sorts of code but cannot get
it to work. something to do with  Dim oStory As Range  but I think
that is for Bookmarks and not formfields which I use.
One can do it by exiting the Userform and then press the TAB key but
that is not user friendly.

How do I carry on? Many thanks for your help.

Lindie
Malcolm Smith - 15 Jan 2005 10:56 GMT
Lindie

I have already replied to your posting in another thread on this very same
newsgroup.  If you go up one message you'll see it.

- Malc

> *From:* Lindie@magichans.com (lindie)
> *Date:* 15 Jan 2005 02:44:44 -0800
[quoted text clipped - 34 lines]
>
> Lindie
Doug Robbins - 15 Jan 2005 13:23 GMT
Add a line ActiveDocument.Fields.Update to you OK routine.  Or if you have
REF fields in the headers and footers, you can use

ActiveDocument.PrintPreview
ActiveDocument.ClosePrintPreview

as a quick way of getting the fields to update.  The alternative is to
Update the Fields in the Range of each Header and Footer in each Section of
the document.
Signature

Please respond to the Newsgroup for the benefit of others who may be
interested.   Questions sent directly to me will only be answered on a paid
consulting basis.

Hope this helps,
Doug Robbins - Word MVP

>I am very proud having put together my first Userform thanks to
> tutorials on the MVP site
[quoted text clipped - 31 lines]
>
> Lindie
Lindie - 22 Jan 2005 00:40 GMT
Many thanks Doug, that worked fine: I used the Print Preview option. a
neat trick.
Lindie

> Add a line ActiveDocument.Fields.Update to you OK routine.  Or if you have
> REF fields in the headers and footers, you can use
[quoted text clipped - 5 lines]
> Update the Fields in the Range of each Header and Footer in each Section of
> the document.
 
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.