View Single Post
 
Old 07-29-2015, 05:32 PM
tddfs tddfs is offline Windows 7 32bit Office 2007
Novice
 
Join Date: Jul 2015
Posts: 3
tddfs is on a distinguished road
Default Send Userform Text to Bookmark

I'm trying to do something similar to https://www.msofficeforums.com/word-...nt-header.html (at least it sounds similar) and also running into the same type of problems. I have userform that pops up when the template is opened but the command button leads to runtime error 5941

Code:
Private Sub CommandButton1_Click()
 
With ActiveDocument
    .Bookmarks("Text1").Range.Text = TextBox1
    .InsertBefore TextBox1
    .Bookmarks("Text2").Range.Text = TextBox2
    .InsertBefore TextBox2
End With
 
UserForm1.Hide
 
End Sub
I've been using a macro to open the userform.

Code:
Sub autonew()
'
' autonew Macro
'
'
UserForm1.Show
End Sub
Any help would be appreciated.

Last edited by macropod; 07-29-2015 at 05:55 PM. Reason: Split from unrelated thread
Reply With Quote