F
Fuzzhead
I have a protected template that has a lot of fields in it the various groups
need to get into just their section of it. I have the following macro that
runs when the user enters bookmark “Text14â€. The macro opens and I can enter
info and hit OK but it does not update the fields in the template. What am I
doing wrong?
Dim frm As frmCorc
Dim oRg As Range
Set frm = New frmCorc
On Error Resume Next
With ActiveDocument
frm.tbxName.Value = .Bookmarks("Text14").Range.Text
frm.tbxDate.Value = .Bookmarks("Text13").Range.Text
frm.JHABox = .Bookmarks("Dropdown9").Range.Text
frm.tbxWhy.Value = .Bookmarks("Text41").Range.Text
End With
frm.Show
If frm.bIsOK Then
With ActiveDocument
Set oRg = .Bookmarks("Text14").Range
oRg.Text = frm.tbxName.Text
.Bookmarks.Add Name:="Text14", Range:=oRg
Set oRg = .Bookmarks("Text13").Range
oRg.Text = frm.tbxDate.Text
.Bookmarks.Add Name:="Text13", Range:=oRg
Set oRg = .Bookmarks("Dropdown9").Range
oRg.Text = frm.JHABox.Text
.Bookmarks.Add Name:="Dropdown9", Range:=oRg
Set oRg = .Bookmarks("Text41").Range
oRg.Text = frm.tbxWhy.Text
.Bookmarks.Add Name:="Text41", Range:=oRg
.Fields.Update
End With
Else
ActiveDocument.Saved = True
End If
Set frm = Nothing
End Sub
need to get into just their section of it. I have the following macro that
runs when the user enters bookmark “Text14â€. The macro opens and I can enter
info and hit OK but it does not update the fields in the template. What am I
doing wrong?
Dim frm As frmCorc
Dim oRg As Range
Set frm = New frmCorc
On Error Resume Next
With ActiveDocument
frm.tbxName.Value = .Bookmarks("Text14").Range.Text
frm.tbxDate.Value = .Bookmarks("Text13").Range.Text
frm.JHABox = .Bookmarks("Dropdown9").Range.Text
frm.tbxWhy.Value = .Bookmarks("Text41").Range.Text
End With
frm.Show
If frm.bIsOK Then
With ActiveDocument
Set oRg = .Bookmarks("Text14").Range
oRg.Text = frm.tbxName.Text
.Bookmarks.Add Name:="Text14", Range:=oRg
Set oRg = .Bookmarks("Text13").Range
oRg.Text = frm.tbxDate.Text
.Bookmarks.Add Name:="Text13", Range:=oRg
Set oRg = .Bookmarks("Dropdown9").Range
oRg.Text = frm.JHABox.Text
.Bookmarks.Add Name:="Dropdown9", Range:=oRg
Set oRg = .Bookmarks("Text41").Range
oRg.Text = frm.tbxWhy.Text
.Bookmarks.Add Name:="Text41", Range:=oRg
.Fields.Update
End With
Else
ActiveDocument.Saved = True
End If
Set frm = Nothing
End Sub