Private Function MyGetComboBoxItem(hWnd As Long) As String ' ' コンボボックス文字列取得 'http://mt-soft.sakura.ne.jp/web_dl/vb-parts/get_combobox/ Dim strItemData As String * 4096 '取得文字列格納用バッファ Dim lngRc As Long Dim Cnt As Long Dim i As Long Dim Dt As String Dim p As Long Cnt = SendMessage(hWnd, CB_GETCOUNT, 0, CLng(0)) '個数取得 Dt = "" For i = 0 To Cnt - 1 MsgBox "ここ1" lngRc = SendMessage(hWnd, CB_GETLBTEXT, i, strItemData) '文字列取得 MsgBox "ここ2" p = InStr(strItemData, vbNullChar) - 1 '文字列長 If p >= 0 Then Dt = Dt & Left(strItemData, p) Dt = Dt & vbCrLf Next i MyGetComboBoxItem = Dt End Function