D
ddowell
I have created a test Word document with a bookmark and cross
reference to it. In the case that when the bookmark is empty, I want
to delete the cross reference and bookmark so that there is no gap in
my text where those items appear.
I have played around with the following code but can't seem how to
find the cross references that relate to the empty bookmark.
Response.Write(doc.Bookmarks.Count) ' will print 1
Response.Write(doc.fields.Count) ' will print 2 one for the
bookmark, and one for the cross reference field (I assume)
if (doc.Bookmark(i).Result = "") then
'get cross referenced fields and delete
'delete bookmark
end if
Bottom line, I don't want gaps in my document where there is no data
being supplied to these fields. If there is a different/better way to
do this, please advise.
Thanks
reference to it. In the case that when the bookmark is empty, I want
to delete the cross reference and bookmark so that there is no gap in
my text where those items appear.
I have played around with the following code but can't seem how to
find the cross references that relate to the empty bookmark.
Response.Write(doc.Bookmarks.Count) ' will print 1
Response.Write(doc.fields.Count) ' will print 2 one for the
bookmark, and one for the cross reference field (I assume)
if (doc.Bookmark(i).Result = "") then
'get cross referenced fields and delete
'delete bookmark
end if
Bottom line, I don't want gaps in my document where there is no data
being supplied to these fields. If there is a different/better way to
do this, please advise.
Thanks