gblf 发表于 2015-9-14 07:28:26

Outlook Form 开发及相关资料

Outlook Form 和VBA Form的编程是不同的。。。

Outlook2003 Forms Help:(MSDN)
http://msdn2.microsoft.com/en-us/library/aa294474(office.11).aspx

Microsoft Outlook Programming ----Book:
http://books.google.co.uk/books?id=bw4Bw0idUCgC&pg=PA361&lpg=PA361&dq=outlook+choose+a+form+add+event&source=web&ots=m0xuX-crKq&sig=SsFd6AGu_OhkICGZQ5j1fYDRrHY&hl=en#PPA5,M1

示例代码:
IDE: Script Editor
  

  
Set conn=Createobject("adodb.connection")   
connStr = "Driver={SQL Server};DataBase=FormDatabase;Server=ZZT-PC\SQLEXPRESS;UID=user;PWD=password"
conn.Open connStr
   
Function Item_Open()

Set cboServiceType = Item.GetInspector.ModifiedFormPages.Item("Message").Controls("cboServiceType")   
  Set rs =Createobject("adodb.recordset")   
   sql = "select * from ServiceType"
   rs.Open sql, conn, 3, 3
   Do While Not rs.EOF
   'MsgBox (rs("ServiceTypeName"))
   cboServiceType.AddItem rs("ServiceTypeName")
   rs.MoveNext
   Loop
  End Function
   
Sub Item_CustomPropertyChange(ByVal Name)
  If Name="MyCategory" Then Exit Sub
  Set cboServiceType = Item.GetInspector.ModifiedFormPages.Item("Message").Controls("cboServiceType")
Set cboCategory = Item.GetInspector.ModifiedFormPages.Item("Message").Controls("cboCategory")
cboCategory.Clear
'MsgBox "="&cboServiceType.value
'MsgBox Name
  Set rs =Createobject("adodb.recordset")   
   sql = "select * from Category,ServiceType where Category.ServiceTypeId=ServiceType.ServiceTypeId and ServiceType.ServiceTypeName='"&cboServiceType.value&"'"
   rs.Open sql, conn, 3, 3
   Do While Not rs.EOF
   'MsgBox (rs("ServiceTypeName"))
   cboCategory.AddItem rs("CategoryName")
   rs.MoveNext
   Loop

End Sub
页: [1]
查看完整版本: Outlook Form 开发及相关资料