473,769 Members | 5,823 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.Applica tion
Private WithEvents objOutlookMsg As Outlook.MailIte m

Sub NewMail()
Set objOutlook = CreateObject("O utlook.Applicat ion")
Set objOutlookMsg = objOutlook.Crea teItem(olMailIt em)

eto = "te**@xxxxtestx xx.com"
esubject = ""

Email_ID = GetGUID

Dim x As UserProperty

x = objOutlookMsg.U serProperties.A dd("CompanyID" , olText) ' <=== error
on this line
objOutlookMsg.U serProperties.I tem("CompanyID" ).Value = Str(Me.ID)

objOutlookMsg.T o = eto
objOutlookMsg.D isplay
End Sub
Nov 12 '05 #1
0 1837

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
3279
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
1770
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, true, XXX???XXX);
1
5723
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
8805
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
1772
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 end, but that doesn't work either. I don't thing the "oCommandBars = Nothing" is actually getting...
1
1856
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 Extensibility.IDTExtensibility2.OnStartupComplete
4
2337
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 takes it and add. So even if one mail comes it will go through all the mails. Is there anything like...
9
2248
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 = CreateObject("Outlook.Application") ' Create the message. Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
0
9586
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9423
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10210
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10043
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9990
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
5446
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3956
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
2
3561
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2814
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.