You could use a GUID to name each bookmark. Naturally, you'll need some way to keep track of the bookmark names. Perhaps Document Variables would be suitable for that.
' creates a GUID, and passes it to the calling entity
Function getGUID() As String
Dim myTypeLib As Object
Dim strg As String
Set myTypeLib = CreateObject("Scriptlet.Typelib")
' Want to chop off the opening and closing brackets, as well as 2 non-printable characters at the end of the string.
strg = myTypeLib.GUID
getGUID = Mid(strg, 2, Len(strg) - 4)
Set myTypeLib = Nothing
End Function
hth,
-Peter
> Hi,
>
[quoted text clipped - 6 lines]
>
> Marcel
Marcel - 13 Dec 2004 19:09 GMT
Hi Peter,
I tested your code and it generates a nice global identifier. Very usefull
to me. I have to strip the dashes and every name should start with an letter
from A-Z. Yes, I'll have to manage the bookmark names but by using document
variables won't work. Doc variables are local to each document and
dissappear after insert. I'll find something to manage that.
Thanks,
Marcel
You could use a GUID to name each bookmark. Naturally, you'll need some way
to keep track of the bookmark names. Perhaps Document Variables would be
suitable for that.
' creates a GUID, and passes it to the calling entity
Function getGUID() As String
Dim myTypeLib As Object
Dim strg As String
Set myTypeLib = CreateObject("Scriptlet.Typelib")
' Want to chop off the opening and closing brackets, as well as 2
non-printable characters at the end of the string.
strg = myTypeLib.GUID
getGUID = Mid(strg, 2, Len(strg) - 4)
Set myTypeLib = Nothing
End Function
hth,
-Peter
> Hi,
>
[quoted text clipped - 9 lines]
>
> Marcel