473,513 Members | 4,116 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Outlook user property

Hi

I am trying to open a new outlook message and add a user defined property to
it, from within MS Access using the below code. I am getting an 'Object
variable or With block variable not set' error on the highlighted line. What
am I doing wrong?

Thanks

Regards

' MS Access code follows

Private WithEvents objOutlook As Outlook.Application
Private WithEvents objOutlookMsg As Outlook.MailItem

Sub NewMail()
Set objOutlook = CreateObject("Outlook.Application")
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)

eto = "te**@xxxxtestxxx.com"
esubject = ""

Email_ID = GetGUID

Dim x As UserProperty

x = objOutlookMsg.UserProperties.Add("CompanyID", olText) ' <=== error
on this line
objOutlookMsg.UserProperties.Item("CompanyID").Val ue = Str(Me.ID)

objOutlookMsg.To = eto
objOutlookMsg.Display
End Sub
Nov 12 '05 #1
0 1813

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
768
by: MaxH | last post by:
I need to perform programmatically from a C# .net application the following tasks: _ open an outlook (or default e-mail client) compose message window; _ attach a document to the new message; _ set message attributes How can I do it? Thank you.
3
3260
by: John | last post by:
Hi I am doing a mailshot by automating outlook from within access. I would like the mailshot to go from a different user address than is set in outlook i.e. instead of user@mydomain.com, I want the recipient to see info@mydomain.com. Is there a way to override sender when sending email via outlook automation? Thanks Regards
0
1756
by: Marcel Stör | last post by:
Hi all, I'm trying to add a user property to an Outlook contact item. VisualStudio tells me that the method signature was like this: UserProperties.Add(string Name,Outlook.OlUserPropertyType Type, object AddToFolderFields, object DisplayFormat) So, what I do is: oMyItem.UserProperties.Add("myProperty",Outlook.OlUserPropertyType.olYesNo,...
1
5709
by: FE | last post by:
> Guys, > > I need to create a program (VB) to dump the outlook profile of a user. > > By dump I mean a report such as : > > User : Mr A > * Folder 1 : exchange mailbox > * Folder 2 : c:\data\pst1.pst > * Folder 2 : c:\data\pst2.pst
8
8780
by: John | last post by:
Hi I am using the latest redemption. I am using the below code in vb.net to send mail in html format. The problem is that text does not get sent as html and html tags appear as they are in the message like '<HTML>' etc. Any idea what I am doing wrong? Thanks Regards
4
1763
by: damian | last post by:
Help! I created a COM addin using vb.net based on the KB article 302896 (http://support.microsoft.com/default.aspx?scid=kb;en-us;302896). The problem is Outlook remains in memory when after it. I know the problem is in the OnStartupComplete function. If I comment this function out, Outlook closes properly. I have added a GC.Collect at the...
1
1848
by: Himselff | last post by:
Hi guys, Im developing a lil add-in that is goiing to allow the user by a button click to auto print PDF doc which are attach to hes emails, i think the things is to simple cause its not working at all, hope u guys can gimme a hand , heres the code, Public Sub OnStartupComplete(ByRef custom As System.Array) Implements...
4
2329
by: Saurabh Sharma | last post by:
Hi I am reading all the mails from a particular outlook folder. I have to check whether i have read the mail earlier or not which i am doing by checking id of mail provided by outlook. Problem is as the number of mails increases it becomes slow coz it goes to everymail and check whether i have read it earlier through code and if not it...
9
2237
by: ARC | last post by:
In case anyone has ran into this yet. The following code used to work with older versions of the MS Outlook library, but would error out in 2007: Dim objOutlook As Outlook.Application Dim objOutlookMsg As Outlook.MailItem Dim objOutlookRecip As Outlook.Recipient Dim objOutlookAttach As Outlook.Attachment Set objOutlook =...
0
7178
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7397
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7563
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7125
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7543
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5102
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3252
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
1612
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
813
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.