メールサーバから、Subject、From、Dateヘッダーの内容のみの一覧を取得

  フォームへコントロールを配置






一覧表示用には、「階層フレキシブルグリッド」を使用します。




「階層フレキシブルグリッド」 以外のコントロールは、「TextBox」「CommandButton」
使用します






  定数と変数



  

標準モジュールを追加して以下を記述

Public Const SMTP As String = "sv30"
Public Const POP As String = "sv30"
Public Const RCVDIR As String = ">d:\lightbox\rcvmail"
Global Basp21 As Object

  



  オブジェクトの作成とコントロールの初期設定

  
' ****************************************************
' 初期処理
' ****************************************************
Private Sub Form_Load()

	Set Basp21 = CreateObject("Basp21")
	
	With flxGrid
	
		.Cols = 5
		.ColWidth(0) = 500
		.ColWidth(1) = 0
		.ColWidth(2) = 5000
		.ColWidth(3) = 2500
		.ColWidth(4) = 2500
		.AllowUserResizing = flexResizeColumns
		.SelectionMode = flexSelectionByRow
		
	End With

End Sub

  



  オブジェクトの後始末

  
' ****************************************************
' 終了処理
' ****************************************************
Private Sub Form_Unload(Cancel As Integer)

	Set Basp21 = Nothing

End Sub

  



  一覧取得処理

  
' ****************************************************
' 一覧取得ボタン
' ****************************************************
Private Sub btnGetList_Click()

	Dim output As Variant
	Dim I As Integer
	
	output = Basp21.RcvMail(POP, _
				txtUser.Text, _
				txtPassword.Text, _
				"LIST", _
				RCVDIR)
							
	If IsArray(output) Then
	
		With flxGrid
	
			.Rows = UBound(output) + 2
		
			For I = 0 To UBound(output)
			
				.Row = I + 1
				.TextMatrix(I + 1, 0) = I + 1
				.Col = 2: .ColSel = 4
				.Clip = output(I)
		
			Next
		
			.Row = 1
			.Col = 1: .ColSel = 4
		
		End With
		
	Else
	
		MsgBox (output)
		
	End If


End Sub

  










  infoboard   管理者用   
このエントリーをはてなブックマークに追加





フリーフォントWEBサービス
SQLの窓WEBサービス

SQLの窓フリーソフト

素材

一般WEBツールリンク

SQLの窓

フリーソフト

JSライブラリ