View Single Post
 
Old 05-24-2017, 09:24 AM
NickDenton NickDenton is offline Windows 8 Office 2016
Novice
 
Join Date: May 2017
Posts: 1
NickDenton is on a distinguished road
Default VBA user forms for auto filling word document

Hi, I am trying to write some simple code in VBA to use user forms to auto fill text in a Word document.
I have created bookmarks in the Word document and text boxes on the User form but when I click the OK command button nothing happens.
this is the code I have written:-

Private Sub cmdOK_Click()
With ActiveDocument
.Bookmarks("BorrowerName").Range.Text = txtBorrowerName.Value
End With

Any help would be gratefully received
Reply With Quote