Microsoft Office Tutorials and References
In Depth Information
Creating Task Items Automatically in Outlook
ExitSub:¶
'Validate if Outlook Application has been set by this code¶
If Not olApp Is Nothing Then¶
'Validate if Outlook Application has a visible explorer¶
'If there is no visible explorer then¶
'it means Outlook Application has been launched from¶
'this code¶
If olApp.ActiveExplorer Is Nothing Then¶
'Quit Outlook Application¶
olApp.Quit¶
End If¶
'Release objects¶
Set olApp = Nothing¶
End If¶
Exit Sub¶
ErrHandler:¶
'An error occured¶
MsgBox Err.Number & "-" & Err.Description, _¶
vbOKOnly + vbExclamation, "Error"¶
Resume ExitSub¶
End Sub¶
' * * * * *¶
Private Function GetOrderInformation() As String¶
'This function Returns Record Information¶
'for the Task Item body as text¶
Dim strBody As String¶
Dim rcset As Recordset¶
'Collect information from data fields for the current record¶
With Me¶
strBody = "PO#:" & vbTab & .PurchaseOrderNumber & vbCrLf & _¶
"Employee:" & vbTab & .EmployeeID.Column(1) & vbCrLf & _¶
"SalesTax %:" & vbTab & .SalesTaxRate & vbCrLf & _¶
"Order Date:" & vbTab & .OrderDate & vbCrLf & _¶
"Ship Date:" & vbTab & .ShipDate & vbCrLf & _¶
"Ship by:" & vbTab & .ShippingMethodID.Column(1) & vbCrLf & _¶
vbCrLf & _¶
"Products" & vbTab & "Price" & vbTab & "Qty" & vbTab & _¶
"Dis" & vbTab & "Total" & vbCrLf & _¶
String(100, "-")¶
'Products from subform recordset¶
With .Order_Details_Subform.Form¶
Set rcset = .Form.Recordset¶
If Not rcset.EOF And Not rcset.BOF Then¶
rcset.MoveFirst¶
End If¶
Do Until rcset.EOF¶
strBody = strBody & vbCrLf & _¶
![ProductID].Column(1) & vbTab & _¶
![UnitPrice].Value & vbTab & _¶
![Quantity].Value & vbTab & _¶
![Discount].Value & vbTab & _¶
Out
Search JabSto ::




Custom Search