Tasks--Export to MS Access

  • Thread starter Thread starter craigs
  • Start date Start date
C

craigs

Hi --
Can someone show me a code snippet to export tasks(eg. Subject,
Complete,etc.) to MS Access. You can do this manually, but I would like to
do it automatically-since there is no macro recorder

Thanks
 
Am Thu, 27 Jul 2006 12:32:53 -0400 schrieb craigs:

This way you can open a connection to the db:

Dim cn As ADODB.Connection
Set cn = New ADODB.Connection
With cn
.Provider = "Microsoft.Jet.OLEDB.4.0"
.ConnectionString = "D:\database.mdb"
.CursorLocation = adUseClient
.Mode = adModeShareDenyNone
.Open
End With

Example for a ref to the currently selected item:

Dim Task as Outlook.TasItem
Set Task=Application.ActiveExplorer.Selection(1)

You can use the Connections's Execute method to write one record into the
db:

Dim cmd$
cmd="insert into
(field1, field2) values (digit, 'string')"
cn.Execute cmd
 
Back
Top