Group:  Microsoft Word ยป microsoft.public.word.vba.userforms
Thread: reLoad a form

reLoad a form
Ali 12/9/2008 1:13:00 AM
Hi

I have designed a form for Word 2007. I would like to know if it's possible
to reload a form from bookmarks data after submitting a form. I mean after I
submitted a form, I need to revise some data and I need to re open the form.
In this case, I need to have the data that has already inserted to the Doc in
the form fields.

Thanks

Re: reLoad a form
"Greg Maxey" <gmaxey[ at ]mIKEvICTORpAPAsIERRA.oSCARrOMEOgOLF> 12/9/2008 1:34:59 AM
Ali,

You can use the UserForm Initialize procedure:

Private Sub UserForm_Initialize()
'Load bookmark value in form control
Me.TextBox1.Text = ThisDocument.Bookmarks("bmOne").Range.Text
End Sub
Private Sub CommandButton1_Click()
'put form control value in document bookmark
Dim oRng As Word.Range
Set oRng = ThisDocument.Bookmarks("bmOne").Range
oRng.Text = Me.TextBox1.Text
ThisDocument.Bookmarks.Add "bmOne", oRng
Me.Hide
End Sub

Ali wrote:
[Quoted Text]
> Hi
>
> I have designed a form for Word 2007. I would like to know if it's
> possible to reload a form from bookmarks data after submitting a
> form. I mean after I submitted a form, I need to revise some data and
> I need to re open the form. In this case, I need to have the data
> that has already inserted to the Doc in the form fields.
>
> Thanks

--
Greg Maxey - Word MVP

My web site http://gregmaxey.mvps.org
Word MVP web site http://word.mvps.org



Home | Search | Terms | Imprint
Newsgroups Reader