A Microsoft Outlook email forum. Outlook Banter

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.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Distributing outlook code



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old October 25th 07, 02:37 AM posted to microsoft.public.outlook,microsoft.public.outlook.program_vba
John
external usenet poster
 
Posts: 135
Default Distributing outlook code

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  
Old October 25th 07, 05:50 AM posted to microsoft.public.outlook,microsoft.public.outlook.program_vba
Michael Bauer [MVP - Outlook]
external usenet poster
 
Posts: 1,885
Default Distributing outlook code



#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
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
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


All times are GMT +1. The time now is 12:21 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.