Public
Sub
AppendToBookmark(
ByVal
Name
As
String
,
ByVal
Expression
As
String
,
Optional
ByVal
NewLine
As
Boolean
=
True
,
Optional
ByVal
Document
As
Word.Document)
If
Document
Is
Nothing
Then
Set
Document = ActiveDocument
If
Not
Document.Bookmarks.Exists(Name)
Then
Err.Raise 5&,
"UpdateBookmark"
Else
Dim
rng
As
Word.Range
Set
rng = Document.Bookmarks(Name).Range
If
NewLine
Then
rng.Text = rng.Text & vbNewLine & Expression
Else
rng.Text = rng.Text & Expression
End
If
Call
Document.Bookmarks.Add(Name, rng)
End
If
End
Sub