How to create unique REF_8749837492 for bookmarks

M

Marcel

Hi,

I've seen that Word is generating its own unique numbers for bookmarks and
links. Does somebody know if there is a function in Word what's generating
this number?

I've created the code below. It's a simple concatenation of ddmmyyhhmmss and
the TickCount in msec from the start of the computer. But I prefer the
standard one if present.

Regards,

Marcel


Declare Function GetTickCount Lib "kernel32" () As Long

Public Function CreateDID() As String
CreateDID = Format(Date, "ddmmyy") + _
Format(Time, "hhmmss") + _
Trim(Str(GetTickCount()))
End Function

Sub do_dump()
Dim ThisDID As String, NextDID As String
ThisDID = PreviousDID = ""
For i = 1 To 10
PreviousDID = ThisDID
ThisDID = CreateDID
Do While ThisDID = PreviousDID
ThisDID = CreateDID
Loop
Debug.Print ThisDID
Next i
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top