![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
This is the top part
Option Explicit Private ins As Outlook.Inspector Private itm As Object Private con As Outlook.AppointmentItem Private appAccess As Access.Application Private fso As Scripting.FileSystemObject Private fld As Scripting.Folder Private strAccessPath As String Private dbe As DAO.DBEngine Private strDBName As String Private strDBNameAndPath As String Private wks As DAO.Workspace Private dbs As DAO.Database Private rst As DAO.Recordset Private ups As Outlook.UserProperties Private fil As Scripting.File Private prp As Outlook.UserProperty Private msg As Outlook.MailItem Public Sub SaveContactToAccess() On Error GoTo ErrorHandler Set ins = Application.ActiveInspector Set itm = ins.CurrentItem If itm.Class olAppointment Then MsgBox "The active Inspector is not a contact item; exiting" GoTo ErrorHandlerExit Else Set con = itm Set appAccess = CreateObject("Access.Application") strAccessPath = appAccess.SysCmd(acSysCmdAccessDir) strAccessPath = strAccessPath & "Outlook Data\" Debug.Print "Access database path: " & strAccessPath Set fso = CreateObject("Scripting.FileSystemObject") Set fld = fso.GetFolder(strAccessPath) Set dbe = CreateObject("DAO.DBEngine.36") strDBName = "../../../../form.mdb" strDBNameAndPath = strAccessPath & strDBName Debug.Print "Database name: " & strDBNameAndPath Set fil = fso.GetFile(strDBNameAndPath) Set wks = dbe.Workspaces(0) Set dbs = wks.OpenDatabase(strDBNameAndPath) Set rst = dbs.OpenRecordset("Form") rst.AddNew Set ups = con.UserProperties Set prp = ups.Find("TransportDate2") If TypeName(prp) "Nothing" Then If prp.Value 0 Then rst!TransportDate = Format(prp.Value, Date) End If End If. Submitted using http://www.outlookforums.com |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Outlook 2007 form into access field format | bear | Outlook and VBA | 7 | October 30th 09 12:38 PM |
pdf format in access 2007 | Grimwadec | Outlook and VBA | 1 | October 12th 09 02:35 PM |
Make field searchable in custom form in outlook 2007 | Irina | Outlook - Using Forms | 1 | May 16th 09 08:56 PM |
How to Access the "To" Recipient field and update it in outlook form | Venkat M | Outlook - Using Forms | 11 | October 13th 08 08:01 PM |
How to access custom field in Custom Form by C# | Minh Nguyen | Outlook - Using Forms | 3 | April 24th 06 03:32 PM |