L
Lisa
I have several templates. I'm going to be inserting a template into
another template. All the templates have bookmarks in them. As you
know, Word will not insert a bookmark with the same name. So when the
new template is inserted, the bookmark is not. I need code to check to
see if there is a bookmark at every place needed(every job number) and
if there is not one, add one so that a typist can put the job number
in.
DMIJOB#Bookmark needs to be here)
After this is done, the patient name and job number will be exported
to a text file. I got this code from another post, but need help
getting the bookmarks by the job numbers.(it just adds it where the
cursor is)
Private Sub InsertBookmark(JobNumbers As String)
' Utility code used by the Insert macros below
If ActiveDocument.Bookmarks.Exists(JobNumbers) = True Then
ActiveDocument.Fields.Add Range:=Selection.Range, _
Type:=wdFieldRef, Text:=JobNumbers
Else
ActiveDocument.Bookmarks.Add Name:="JobNumbers", _
Range:=Selection.Range
End If
End Sub
Thanks!
another template. All the templates have bookmarks in them. As you
know, Word will not insert a bookmark with the same name. So when the
new template is inserted, the bookmark is not. I need code to check to
see if there is a bookmark at every place needed(every job number) and
if there is not one, add one so that a typist can put the job number
in.
DMIJOB#Bookmark needs to be here)
After this is done, the patient name and job number will be exported
to a text file. I got this code from another post, but need help
getting the bookmarks by the job numbers.(it just adds it where the
cursor is)
Private Sub InsertBookmark(JobNumbers As String)
' Utility code used by the Insert macros below
If ActiveDocument.Bookmarks.Exists(JobNumbers) = True Then
ActiveDocument.Fields.Add Range:=Selection.Range, _
Type:=wdFieldRef, Text:=JobNumbers
Else
ActiveDocument.Bookmarks.Add Name:="JobNumbers", _
Range:=Selection.Range
End If
End Sub
Thanks!