Function Windows API Class

CharToOem

"ANSI Characters To OEM Characters" Converts ANSI (Windows) characters to the OEM (DOS) character set. Used to be known as AnsiToOem.

Signature (Visual Basic / VBA)

Public Function CharToOem( _
    ByVal vANSIString As Variant _
    ) As Variant

Code Example

    CharToOem("Hawaii") = "Hawaii"

Parameters

Parameter Description
vANSIString String that contains characters from the ANSI Windows character set. Function returns Null if vANSIString is Null or cannot be fixed-up to a String.

Return Value

The result string contains the corresponding characters from the OEM character set.

Notes & Version History

v1.3 Change Removed 16-bit support from this function.