|
-
Oct 16th, 2003, 12:35 PM
#22
To change the code to use the Task folder.
Then you will need to write similar function to export the tasks to
a Tasks table.
VB Code:
Option Explicit
Private oApp As Outlook.Application
Private oNS As Outlook.NameSpace
Private oInbox As Outlook.MAPIFolder
Private oTasks As Outlook.MAPIFolder
Private CnnA As ADODB.Connection
Private Sub cmdExportEmails_Click()
Call Outlook_Emails_2_Access
End Sub
Private Sub Form_Load()
Set oApp = New Outlook.Application
Set oNS = oApp.GetNamespace("MAPI")
Set oInbox = oNS.GetDefaultFolder(olFolderInbox)
Set oTasks = oNS.GetDefaultFolder(olFolderTasks)
'MUST BE A FOLDER WITH A DEFAULT MESSAGE TYPE OF POST!!!
'RIGHT CLICK ON THE DESIRED NEW FOLDER AND CLICK PROPERTIES.
'THEN LOOK AT THE BOTTON AND IT SHOULD SAY -
'"WHEN POSTING TO THIS FOLDER, USE: POST"
' Set oInbox = oNS.Folders("Your Custom Folder Name Here!")
Set CnnA = New ADODB.Connection
CnnA.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & txtDBPath & ";Persist Security Info=False"
CnnA.Open
End Sub
Glad to help.
How about a honorable mention in your programs about credits?
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|