コントロールの内容をファイルに書き出します。
#Include <GuiRichEdit.au3>
_GUICtrlRichEdit_StreamToFile($hWnd, $sFilespec [, $fIncludeCOM=True [, $iOpts=0 [, $iCodePage = 0]]])
パラメータ
| $hWnd | コントロールのハンドル | 
| $sFileSpec | ファイル指定 | 
| $fIncludeCOM | 	[オプション]  True (デフォルト): .rtfファイルに書き出す場合、全てのCOMオブジェクトを含めます (スペースを消費します)。 その他のファイルに書き出す場合、COMオブジェクトのテキスト表現を書き出します。 False: COMオブジェクトの代わりにスペースを書き出します。  |    
  
| $iOpts | 	[オプション] 追加オプション: $SFF_PLAINTRTF - 全ての言語で共通なリッチテキスト句のみ書き出します。 $SF_UNICODE - Unicodeで書き出します。  | 
  
| $iCodePage | 	[オプション] UTF-8とこのコードページを使用するテキストを生成します。 デフォルト: 生成しません。  |    
  
返し値
| 成功: | True | 
| 失敗: | Falseを返し、@errorを設定します。 | 
| @error: | 101 - $hWndがハンドルではありません。 | 
| 102 - $sFilespecを作成できません。 | |
| 1041 - $SFF_PLAINRTFがテキストファイル用として不正です。 | |
| 1042 - $opts: 不正なオプションです。 | |
| 1043 - $SF_UNICODEはテキストファイルに対してのみ有効です。 | |
| 700 - 内部エラー | 
注意
テキストが選択されている場合は選択部のみ書きだされ、それ以外の場合はコントロール内の全てのテキストが書き出されます。
関連
_GUICtrlRichEdit_SetLimitOnText, _GUICtrlRichEdit_StreamFromVar, _GUICtrlRichEdit_StreamToVar, _GUICtrlRichEdit_StreamFromFile
こちらも参照
MSDNライブラリでEM_STREAMINを検索して下さい。
例
#AutoIt3Wrapper_Au3Check_Parameters= -d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6
#include <GuiRichEdit.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Main()
Func Main()
    Local $hGui, $hRichEdit, $iMsg
    $hGui = GUICreate("Example (" & StringTrimRight(@ScriptName,4) &")", 320, 350, -1, -1)
    $hRichEdit = _GUICtrlRichEdit_Create($hGui, "This is a test.", 10, 10, 300, 220, _
            BitOR($ES_MULTILINE, $WS_VSCROLL, $ES_AUTOVSCROLL))
    GUISetState()
    _GuiCtrlRichEdit_AppendText($hRichEdit, "Para with default border settings")
    MsgBox(4096, "", "The default paragraph border settings are " & _GUICtrlRichEdit_GetParaBorder($hRichEdit))
    _GuiCtrlRichEdit_AppendText($hRichEdit, @CR & "Second paragraph")
    _GUICtrlRichEdit_SetParaBorder($hRichEdit, "o", 3, "mag", 0.25)
    MsgBox(4096, "", "Border settings of second paragraph are " & _GUICtrlRichEdit_GetParaBorder($hRichEdit))
    _GuiCtrlRichEdit_SetSel($hRichEdit, 10, -1)
    Sleep(1000)
    MsgBox(4096, "", "Border settings of first paragraph in the selection are " & _GUICtrlRichEdit_GetParaBorder($hRichEdit))
    ; 外枠から左枠へ変更
    _GUICtrlRichEdit_SetParaBorder($hRichEdit, "l")
    ; Wordで枠線設定を確認できるように全てのテキストをデスクトップに保存
    _GUICtrlRichEdit_Deselect($hRichEdit)
    _GuiCtrlRichEdit_StreamToFile($hRichEdit, @DesktopDir & "\gcre.rtf")
    While True
        $iMsg = GUIGetMsg()
        Select
            Case $iMsg = $GUI_EVENT_CLOSE
                GUIDelete()
                Exit
        EndSelect
    WEnd
EndFunc   ;==>Main