Quote:
Originally Posted by gmayor
|
Thank you, gmayor!
I have seen a YouTube tutorial and I basically followed everything. I got the UserForm that I want once you open the document but for some reason the "Client" field which I have bookmarked in the document isn't being populated by whatever it is that I am typing in the userform under the Client field.
Here's the code that I've been using:
Quote:
Private Sub CommandButton1_Click()
Dim RepTitle As Range
Set RepTitle = ActiveDocument.Bookmarks("RepTitle").Range
RepTitle.Text = Me.TextBox1.Value
Dim ReportDate As Range
Set ReportDate = ActiveDocument.Bookmarks("ReportDate").Range
ReportDate.Text = Me.TextBox2.Value
Dim Client As Range
Set Client = ActiveDocument.Bookmarks("Client").Range
Client.Text = Me.TextBox3.Value
Dim ContactName As Range
Set ContactName = ActiveDocument.Bookmarks("ContactName").Range
ContactName.Text = Me.TextBox4.Value
Dim ContactAdd As Range
Set ContactAdd = ActiveDocument.Bookmarks("ContactAdd").Range
ContactAdd.Text = Me.TextBox5.Value
Dim DivInCharge As Range
Set DivInCharge = ActiveDocument.Bookmarks("DivInCharge").Range
DivInCharge.Text = Me.TextBox6.Value
Me.Repaint
UserForm1.Hide
End Sub
|
I am using Word 2013. Should that be an issue re bookmarks? And also, how do I make the userform disappear as soon as I hit the "OK" button?
Thank you for all the help!