[ABAP] Sprachausgabe im SAP über Microsoft SAPI.SpVoice

DATA: v_objole TYPE ole2_object.
DATA: o_voice  TYPE ole2_object.
DATA: lv_satz  TYPE string.

CREATE OBJECT o_voice 'SAPI.SpVoice'.

SET PROPERTY OF o_voice 'Volume' = 100.
SET PROPERTY OF o_voice 'Rate' = -1.
*SET PROPERTY OF o_voice 'Voice' = 0.

lv_satz = 'SAP ist toll!'.

CALL METHOD OF o_voice 'Speak' = v_objole
  EXPORTING
    #1 = lv_satz
    #2 = 1. " SVSFlagsAsync.

FREE OBJECT: o_voice.
FREE OBJECT: v_objole.