473,406 Members | 2,390 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Using Access VBA to update Outlook

266 256MB
I was curious if there is a way to use a form in access and send that data to the default outlook calendar as an appt. I have tried this code but it doesn't seem to work.

Expand|Select|Wrap|Line Numbers
  1. Dim olApp As Outlook.Application
  2.   Dim objAppointment As Outlook.AppointmentItem
  3.   Dim objAppointments As Outlook.MAPIFolder
  4.   Dim objNameSpace As Outlook.NameSpace
  5.   Dim objProperty As Outlook.UserProperty
  6.   Dim OutlookStartTime, OutlookEndTime As Date
  7.   Dim sFilter As Variant
  8.  
  9.   OutlookStartTime = CDate(ap_date & " " & ap_start_time)
  10.   OutlookEndTime = CDate(ap_date & " " & AP_End_Time)
  11.  
  12.   Set olApp = CreateObject("Outlook.Application")
  13.   Set objNameSpace = olApp.GetNamespace("MAPI")
  14.   Set objAppointments = objNameSpace.GetDefaultFolder(olFolderCalendar)
  15.  
  16.   sFilter = "[Start] = '" & Format(OutlookStartTime, "ddddd h:nn AMPM") & _
  17.     "' And [End] = '" & Format(OutlookEndTime, "ddddd h:nn AMPM") & "' " & _
  18.     " And [Subject] = '" & Me.ap_with_whom & " - " & Me.ap_type & "'"
  19.  
  20.   Set objAppointment = objAppointments.Items.Find(sFilter)
  21.  
  22.   If Not TypeName(objAppointment) = "Nothing" Then
  23.     objAppointment.Delete
  24.   End If
  25.  
  26.   Set objAppointment = Nothing
  27.   Set objAppointments = Nothing
  28.  
Sep 20 '22 #1
4 8640
NeoPa
32,556 Expert Mod 16PB
Grrrr.

265 posts and you're still writing questions like this? You should be embarrassed. Copy/pasting a chunk of code with a short sentence explaining ???. What? It doesn't work!

What works? What doesn't? Does it even compile? What do you see to show you it doesn't work if/when you try to run it?
Sep 20 '22 #2
didacticone
266 256MB
HAHAHA, OK... I wrote a quick post to start a dialog... what's up your ass dude? Apologies, I haven't grown at the programming pace you would like, no need to turn toxic about it. Asking a question on a forum intended for questions to be asked is embarrassing? Sad that you feel so entitled on a message board to talk to people like this, that's what is actually embarrassing, lol. That's the sad thing about you keyboard warriors. Get me banned or whatever you want big shot, enjoy the power, lol. Later my friend.
Sep 20 '22 #3
DJRhino1175
221 128KB
I did build a database based on what's in the code above and had to add a reference to Microsoft outlook. Once I did that everything compiled. So I tried running the code using a Click a button, but nothing seemed to happen. When I opened outlook no new appointment was made. I hope this helps with getting this figured out for the one asking the question.
Sep 20 '22 #4
NeoPa
32,556 Expert Mod 16PB
You're 100% wrong. I was biting my tongue.

In reality it seems clear to me that you're both lazy and entitled. Your minimalist attempt at a question wasn't just embarrassing - it was actually quite shocking. New members get away with that as it can be confusing for someone new to asking questions on a forum exactly what is expected and how best to go about doing that.

In your case however, this is repeated behaviour, and this isn't the first time I've had to make the same point. It's not an uncommon response from those who feel thus entitled to do Sweet Fanny Adams as far as their own effort's concerned and expect others to do all the heavy lifting on their behalf, to get all upset and hard-done-by when someone, who is there purely and simply to help, has to get side-tracked into explaining that it's not even possible when those asking the questions avoid including any of the information that would be required in order to provide such help.

You're right - almost. As administrator, and even as a moderator, I wouldn't need to get you banned as we have the power to ban you directly for a period, but that would be like using physical violence on an impertinent child. It would reflect worse on me even than on you. Be warned - I will never be so lenient when I come across such behaviour with any of my junior colleagues.

I can't help feeling that you've rather soured your chances of getting some of our volunteer experts to make the extra effort to help you though, when you react in such an entitled way. I know that I steer well clear of such members when I see behaviour like that (Other than continuing to monitor of course).
Sep 21 '22 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: ifeoma | last post by:
I have a script which sends emails through Access. It sends these emails as if it was sent through Outlook. I had no problem with this using Office 2000 but with the newer Outlook 2002 it asks if I...
4
by: Ecohouse | last post by:
I need to be able to access an Outlook folder and read each email and pull data from the email into tables in Access and move the email to another folder. I now about automation but am not sure...
4
by: Nicole | last post by:
I found this code below to use to send emails using VB with Outlook. However, it gives these errors. 'Send' is ambiguous across the inherited interfaces 'Outlook._MailItem' and...
2
by: sbw | last post by:
I am getting an intermittent problem when I try to create an Outlook mail item using access vba. Having tested if outlook is already running so that I can either create an outlook.application or...
5
by: Kosmos | last post by:
I have traveled the world and the seven seas and I have yet to come up with an answer to this question.... So I'm adding an attachment to an email from access... The following is the code: ...
0
by: Tim Hunter | last post by:
Hi, i am using Access 2003 on Win2000 desktop. I have an application that supports a Customer db for a restaurant. This application will also select from the Customer table and either print labels...
6
by: ttamilvanan81 | last post by:
Hai. I needto Receive Email using Ms-Access and Outlook. On the receiving end, the user receives the email at the Outlook. When they opens the Email, the message box should have a button called...
1
by: Paul Brady | last post by:
This must be a common operation, but I have searched this newsgroup and have wrestled with the help messages, and I seem to need help with this simple task. I have an Access 2000 database which,...
8
by: Bay0519 | last post by:
Hi, I'm using access and outlook 2003. I have a form in access that show product test information (test #, action, etc) using product ID as PK. what I need to accomplish is once, the test...
7
Jerry Maiapu
by: Jerry Maiapu | last post by:
Hello everyone, I have searched the forum and internet on collecting data from outlook into access with custom formatting but no there is no resource to assist. I 'have looked at the following...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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,...
0
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...
0
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...
0
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...

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.