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
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