Is the caption actually stored as multiple lines of text in the Caption property of the button in design view? (the only way I could find to do this was via copy and paste)
Or is it just one line and you have the buttons sized so that word wrap moves the translation portion to the "second" line?
If the former, then you can look for the occurrence of Carriage Return and/or Line Feed characters and return only the value to the left of that. For example, let's say you have the following caption on multiple lines in the caption of the command button;
Hello
Hola
in VBA, the following -
MsgBox Me.Command1.Caption
- would return;
Hello
Hola
and any of the following -
MsgBox Left(Me.Command1.Caption, InStr(1, Me.Command1.Caption, Chr(10)) - 1)
MsgBox Left(Me.Command1.Caption, InStr(1, Me.Command1.Caption, Chr(13)) - 1)
MsgBox Left(Me.Command1.Caption, InStr(1, Me.Command1.Caption, vbCrLf) - 1)
- would return;
Hello
If the latter (the caption text is all on one line) then you would need another method to separate the foreign translation portion. You could look for the occurrence of a space but that would only work if each portion was only a single word. Another option would be to put the foreign translation portion in parentheses -
Hello (Hola)
- and the look for the occurrence of the beginning paren. Example;
MsgBox Left(Me.Command1.Caption, InStr(1, Me.Command1.Caption, "(") - 1)
- would return;
Hello