STRPTR(ptr)

Returns a LongPtr on a 64 bit version and a Long on a 32 bit version.


ptrThe string variable

REMARKS
* This is often used when passing in UNICODE strings.
* This function can tell the difference between an empty string ("") and a Null string (vbNullString).
* This function does not appear in the intellisense.
* This function was added in Office 2010.
* This is similar to the OBJPTR function.
* This is similar to the VARPTR function.

Debug.Print StrPtr("")            '= non-zero  
Debug.Print StrPtr(vbNullString) '= zero

Dim sResult As String
sResult = StrPtr("sometext")
Debug.Print sResult

© 2022 Better Solutions Limited. All Rights Reserved. © 2022 Better Solutions Limited Top