T
Tim Flohrschutz
I'm adding a UserForm to a Word template. Upon submitting the form, I receive 'Runtime Error 6028 - The range cannot be deleted'. The debugger points to the following script:
Private Sub CmdSubmit_Click()
Application.ScreenUpdating = False
With ActiveDocument
--> .Bookmarks("Text1").Range.Text = txtUserName.Value
.Bookmarks("Text2").Range.Text = txtTest1.Value
.Bookmarks("Text3").Range.Text = txtTest2.Value
.Bookmarks("Text4").Range.Text = txtTest1.Value
End With
Application.ScreenUpdating = True
Unload Me
End Sub
This is a simple test form I have created before I begin working on the real document. On occassion, there will be values that are displayed in multiple places, hence the repition of txtTest1.
I am new to VB coding and any assistance would be greatly appreciated.
Private Sub CmdSubmit_Click()
Application.ScreenUpdating = False
With ActiveDocument
--> .Bookmarks("Text1").Range.Text = txtUserName.Value
.Bookmarks("Text2").Range.Text = txtTest1.Value
.Bookmarks("Text3").Range.Text = txtTest2.Value
.Bookmarks("Text4").Range.Text = txtTest1.Value
End With
Application.ScreenUpdating = True
Unload Me
End Sub
This is a simple test form I have created before I begin working on the real document. On occassion, there will be values that are displayed in multiple places, hence the repition of txtTest1.
I am new to VB coding and any assistance would be greatly appreciated.