Function String Extras Class

PrefixSendKeysMetaCharacters

Fixes-up a string literal so that none of the characters within it will have unintended special meanings when used with the Visual Basic SendKeys statement.

Signature (Visual Basic / VBA)

Public Function PrefixSendKeysMetaCharacters( _
    ByVal vSendKeys As Variant _
    ) As String

Code Example

    PrefixSendKeysMetaCharacters("Reg. Text") = "Reg. Text"
    PrefixSendKeysMetaCharacters("Press {Del}") = "Press {{}Del{}}"

Parameters

Parameter Description
vSendKeys String containing characters which should be sent literally by the SendKeys statement. vSendKeys defaults to an empty string if it is Null or cannot be fixed up to a String.

Notes & Version History

Note Any characters such as braces ({) within string vSendKeys will be prefixed so that the SendKeys statement does not interpret them as part of some special keyboard character. For example, SendKeys would normally interpret the string "{Del}" as a request to send the {Del} key. This function turns such a string into a request to send five separate characters.