Group:  Microsoft Word ยป microsoft.public.word.vba.userforms
Thread: Bookmark updating form issue.

DotNetBag
.NET Development Newsgroups

HTVi
TV Discussion Newsgroups

Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
Rising Antivirus 2006

Bookmark updating form issue.
ryanj 27.01.2006 18:10:02
I created a form that pops up when a user opens this template. The template
is a birth certificate. When the user opens the template my form pops up and
they fill it out. Once they are done, they click on the submit button. The
information they typed in the form then gets placed on the Birth Certificate
were the book marks are located. My problem is my bookmarks have a grey
space were the information goes, but what it is down is it is placing the
information before my bookmark and leaving the bookmark there. Here is an
example; I type my first name in the first name text box, Ryan. I click the
submit button. Then were I want my first name Ryan to appear I get:
RyanFirst Name Goes Here

The First Name Goes Here is my bookmark that I want to get replaced with
Ryan. Here is my code:


Sub UserForm_Initialize()
cboAMPM.List = Array("AM", "PM")
End Sub

Private Sub cmdSubmit_Click()
With ActiveDocument
.Bookmarks("txtFName").Range _
.InsertBefore TextFName
.Bookmarks("txtMName").Range _
.InsertBefore TextMName
.Bookmarks("txtLName").Range _
.InsertBefore TextLName
.Bookmarks("txtMonth").Range _
.InsertBefore TextMonth
.Bookmarks("txtDay").Range _
.InsertBefore TextDay
.Bookmarks("txtYear").Range _
.InsertBefore TextYear
.Bookmarks("txtHour").Range _
.InsertBefore TextHour
.Bookmarks("txtMinute").Range _
.InsertBefore TextMinute
.Bookmarks("txtAMPM").Range _
.InsertBefore cboAMPM
.Bookmarks("txtPounds").Range _
.InsertBefore TextPounds
.Bookmarks("txtOunces").Range _
.InsertBefore TextOunces
.Bookmarks("txtInches").Range _
.InsertBefore TextInches
End
End With
End Sub

I can't seem to figure out what to do next. Thank you for your time.

Ryan Janis
r_janis[ at ]hotmail.com

Re: Bookmark updating form issue.
"Tony Jollans" <My Forename at My Surname dot com> 27.01.2006 18:25:57
To simply replace the bookmark, use ...

..Bookmarks("txtFName").Range _
.Text = TextFName

etc.

--
Enjoy,
Tony


"ryanj" <ryanj[ at ]discussions.microsoft.com> wrote in message
news:2460C011-4BCC-4F2A-AA6A-3ED9690C6623[ at ]microsoft.com...
[Quoted Text]
> I created a form that pops up when a user opens this template. The
template
> is a birth certificate. When the user opens the template my form pops up
and
> they fill it out. Once they are done, they click on the submit button.
The
> information they typed in the form then gets placed on the Birth
Certificate
> were the book marks are located. My problem is my bookmarks have a grey
> space were the information goes, but what it is down is it is placing the
> information before my bookmark and leaving the bookmark there. Here is an
> example; I type my first name in the first name text box, Ryan. I click
the
> submit button. Then were I want my first name Ryan to appear I get:
> RyanFirst Name Goes Here
>
> The First Name Goes Here is my bookmark that I want to get replaced with
> Ryan. Here is my code:
>
>
> Sub UserForm_Initialize()
> cboAMPM.List = Array("AM", "PM")
> End Sub
>
> Private Sub cmdSubmit_Click()
> With ActiveDocument
> .Bookmarks("txtFName").Range _
> .InsertBefore TextFName
> .Bookmarks("txtMName").Range _
> .InsertBefore TextMName
> .Bookmarks("txtLName").Range _
> .InsertBefore TextLName
> .Bookmarks("txtMonth").Range _
> .InsertBefore TextMonth
> .Bookmarks("txtDay").Range _
> .InsertBefore TextDay
> .Bookmarks("txtYear").Range _
> .InsertBefore TextYear
> .Bookmarks("txtHour").Range _
> .InsertBefore TextHour
> .Bookmarks("txtMinute").Range _
> .InsertBefore TextMinute
> .Bookmarks("txtAMPM").Range _
> .InsertBefore cboAMPM
> .Bookmarks("txtPounds").Range _
> .InsertBefore TextPounds
> .Bookmarks("txtOunces").Range _
> .InsertBefore TextOunces
> .Bookmarks("txtInches").Range _
> .InsertBefore TextInches
> End
> End With
> End Sub
>
> I can't seem to figure out what to do next. Thank you for your time.
>
> Ryan Janis
> r_janis[ at ]hotmail.com
>


Home | Search | Terms | Imprint | Contact
Newsgroups Reader - provided by WiredBox.Net