![]() |
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
|
|||
|
|||
![]()
Hi
I have a very simple piece of vba code in outlook as below which references DAO 3.6 and Outlook 12 Object Library. My questions are; 1. How can I distribute this code? Is it possible to make some sort of setup that end users can run to automatically install this code in their outlooks? 2. Will the code work on OL2000 and upwards without any change? Thanks Regards Code Follows ========= Option Explicit Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean) Dim St As String Dim EmailItem Dim db As DAO.Database Dim ws As DAO.Workspace Dim rst As DAO.Recordset Dim Subject As String Dim Company_ID As String Set EmailItem = Item Company_ID = EmailItem.UserProperties.Item("CompanyID").Value Subject = EmailItem.Subject St = " SELECT """ & Subject & """ as Subject, """ & Company_ID & """ as ID INTO MyTable" Set ws = DBEngine.Workspaces(0) Set db = ws.OpenDatabase("C:\db1.mdb") db.Execute (St) End Sub |
#2
|
|||
|
|||
![]() #1 Please read: http://www.outlookcode.com/article.aspx?id=28 #2 It should work if you copy the code into OL 2000. But if you decide to create a VB6 addin you must add a reference to the oldest Outlook version that you want to support. -- Viele Gruesse / Best regards Michael Bauer - MVP Outlook Organize eMails: http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6 Am Thu, 25 Oct 2007 02:37:08 +0100 schrieb John: Hi I have a very simple piece of vba code in outlook as below which references DAO 3.6 and Outlook 12 Object Library. My questions are; 1. How can I distribute this code? Is it possible to make some sort of setup that end users can run to automatically install this code in their outlooks? 2. Will the code work on OL2000 and upwards without any change? Thanks Regards Code Follows ========= Option Explicit Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean) Dim St As String Dim EmailItem Dim db As DAO.Database Dim ws As DAO.Workspace Dim rst As DAO.Recordset Dim Subject As String Dim Company_ID As String Set EmailItem = Item Company_ID = EmailItem.UserProperties.Item("CompanyID").Value Subject = EmailItem.Subject St = " SELECT """ & Subject & """ as Subject, """ & Company_ID & """ as ID INTO MyTable" Set ws = DBEngine.Workspaces(0) Set db = ws.OpenDatabase("C:\db1.mdb") db.Execute (St) End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Distributing outlook code | John | Outlook - General Queries | 1 | October 25th 07 05:50 AM |
Distributing Company Events via Outlook | Gunnertac | Outlook - Calandaring | 6 | September 20th 07 09:36 PM |
Distributing Outlook templates (.oft files) | Amedee Van Gasse | Outlook - General Queries | 3 | May 18th 07 01:05 PM |
Distributing Outlook templates (.oft files) | Amedee Van Gasse | Outlook - Using Forms | 3 | May 18th 07 01:05 PM |
Help!! Distributing an outlook search? (.OSS) | [email protected] | Outlook - General Queries | 2 | February 20th 06 04:26 PM |