Double Appointments Delete
Hallo *,
i need a Code witch search my Appointment's in Outllok and list the double Items ready to delete? (maybe with Listview) Can anybody help me to create the syntax or to found the syntax
thx woerny
from würzburg
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Delete Outlook 200 Calendar Appointments Using Visual Basic 6.0
Hi there,
I am new to Visual Basic and in hope that someone can help in this project that I am working on.
I am trying to delete any future appointments that are in a Public calendar....basically anything greater than today's date.
I have Calendar item called "ProjectTest" in the Outlook Public Folders folder.
How do I reference the items in that folder only?
Also is there way for me to delete all of the appointments within a certain date range ( > today's date)?
For example, in SQL Server, I would use this query to delete all future appointments:
DELETE from AppointmentTable
WHERE StartTime > GetDate()
Is there something in VB that I can use to delete a bunch of appointments?
Any help would help me a lot.
Thank you!
Listview Double-click Delete Row
Hi guys,
I have a listview with three columns.
A user may double-click a row to remove that row from the listview (and all rows below move up to take the deleted row's place).
Problem is, if the user double clicks in the empty space *below* the list items, the list item last selected is deleted!
How do I stop this behaviour?
I assume I'd have to test for validity of the double-click event but how do I test for a user double clicking the vacant area?
Thanks,
Mark
Appointments
I don't know if anyone remebers but i asked a while ago how to make an appointments system displaying todays appointments in a window on the interface. Double bookings must also be avoided.
P.S. i wanna integrate Excel with Vb6
Appointments
I'm having some difficulty with dimming a text box and then viewing it when something else is clicked on that is linked to it.
I'm also having problems with checking for duplicate date and time in a database through vb. Don't want same date and time duplicated.
Error In "double = Double - Double" Statement
I am trying to compute the differnece between two dwords in visual basic and
keep getting the wrong value being computed. I have the following structure
defind:
Public Type HighLowQuote
TradeDate As String
OpenPrice As Double
HighPrice As Double
LowPrice As Double
ClosePrice As Double
Volume As Long
AdjClosePrice As Double
AmtChange As Double
End Type
I create an instance of this type as 'q'. I then do the following:
q.highprice = variant
q.lowprice = variant
at this point the locals variable window shows the values as:
q.highprice = 4.1
q.lowprice = 4
I then fall through the following code:
q.AmtChange = q.highprice - q.lowprice
q.amtchange is then valued at 9.99999999999996E-02 in the locals window when
I believe it should be valued at .1.
Why is the value not being set to .1? Is there a change I can make to get
this calculation to work how I expect or is there some other way to perform
these calculations to get the results I am after?
Any help would be appreciated. Thanks in advance.
Outlook Appointments
Hi folks,
i want to retrieve the appointments from outlook. I can create a new app with no problem, but i have to edit already saved appointments.
How can i do this?
TIA
ByeZ
BiZ
Outlook Appointments
Hi,
I'm new to VBA, VB+Office. I had a question though. Is there a way to make it so that when a user creates a new appointment, after they save it, the Subject will automatically be whatever the contact name that was chosen?
thanks.
Outlook All Day Appointments
Hello,
I wrote a small application that will allow me to pull appointments from a Lotus Notes mailbox into an Access DB then to my Outlook Calendar. I don't have access to the LN db to go directly to it, which is why I am doing it this way. I ran into a problem where when I attempt to compare the appointments that already exist in my Outlook Calendar (to avoid duplicates), I am seeing everything but the appointments that are AllDayEvents.
The code looks like:
Public Function ItemCount() As Integer
Set OlApp = CreateObject("Outlook.Application")
Set myNS = OlApp.GetNamespace("MAPI")
Set myAppts = myNS.GetDefaultFolder(olFolderCalendar).Items
myAppts.Sort "[Start]"
myAppts.IncludeRecurrences = True
strTheDay = "[Start] >= '" & StartDate & " 12:01 AM'" & " and [Start] <='" & StartDate & " 11:59 PM'"
Set myAppts = myAppts.Restrict(strTheDay)
ItemCount = 0
Dim x As Long
For x = 1 To myAppts.Count
Set myAppt = myAppts.Item(x)
If Not (myAppt Is Nothing) Then
Debug.Print ItemCount
Debug.Print "Subject:" & myAppt.Subject
Debug.Print "Start:" & myAppt.Start
Debug.Print "End:" & myAppt.End
Debug.Print "All Day:" & myAppt.AllDayEvent
ItemCount = ItemCount + 1
Else
Set myAppt = Nothing
Exit Function
End If
Set myAppt = Nothing
Next
End Function
Any help would be very much appreciated.
Appointments System
I would like to make an appointments system linking visual basic to Excel. i want it to display the appointments for that day in an OLE box but allow all inputs to be entered using visual basic. it must also check for double bookings. Is there any way to do this. I am no good at integrating office and VB6
Checking Appointments
I am writing a DLL that uses the Outlook Object Model for Reading my appointments. To get all the recurrences, I sort the collection myItems(:Calendar.items) and then I set Includerecurrences at true.
The problem is that he says that I have 2.147483647 appointments, while I have only 10 real appointments. Is there a way to check if the appointment is real or not?
I have already tried with : If objItem(:the appointmentitem) <> Nothing Then ...
But this doesn't seem to work. He says that it is an invalid use of object.
Who can help me to test if the appointment is real?
Greetings
Outlook Appointments
Hi,
I want to set an appointment for a contact i have from my visual basic application. The user would choose the contact, date and time from my VB application and at the click of a button the info goes into outlook calendar, i can do this.Also if i select the same date and time for another contact, it just keeps adding appointment to the already taken up date and time. How do i prevent multiple appointments at the same time and date (because i would not be viewing the calendar as such but rather set up appointments from my VB application). So basically how do i check before setting an appointment that the time and date is not already taken up (unavailable).
thanks
Surya
Outlook Appointments
hello
I am trying to collect all appointment records from an outlook calendar and display each appointment in a list box, however I get a object dosent support this method error
any advise would be much aprechiated:
[CODE}
Private Sub Form_Load()
Dim olAPP As Outlook.Application
Dim olNs As Outlook.NameSpace
Dim oItem As Outlook.AppointmentItem
Dim oSelection As Selection
Set olAPP = CreateObject("Outlook.Application")
Set olNs = olAPP.GetNamespace("MAPI")
olNs.GetDefaultFolder(olFolderCalendar).Display
Set objFolder = OutlookApplication.ActiveExplorer.CurrentFolder
For Each oItem In objFolder
MsgBox ("aye")
Next
End Sub
{/CODE}
Appointments Is Groupwise
heho,
I'm tryin' to make an appointment from VB To Groupwise.
But I get stuck filling the startdate and time.
I get an Error 13"
This is what I do.
sStartDate = "2003/1/24 AT 12:00:00"
Please can some one help me out?
Thanks a lot vbboddy's
Otto
Getting Appointments From Outlook In A Form
I'm trying to get appointments from outlook into a form. I want to display al the appointments of today in a textbox or something. Can anyone give me a little push. I've seen some threads but they are not showing what I want to do.
Recurring Appointments From Outlook
Hi All,
I am Displaying all the appoinmnets from outlook in My Applicaton.
I do not have problems if it a normal Appointment.
It is having problem if it is a recurring appointment.I am not able to loop the recurrences....
Can any body help........
Code:
For Each Item In AllContacts
If Item.IsRecurring = True Then
MsgBox "Recurring Appointment"
Dim spRecurrence 'As String
Set spRecurrence = Item.GetRecurrencePattern
MsgBox spRecurrence.Occurrences
Dim Item1
For Item1 = 0 To spRecurrence.Occurrences
''''''''''''''''''''''''''''''''''''''''''''''''Here is the Problem ''''''''
Next
'Set spExceptions = spRecurrence.GetOccurrence(DateValue(Item.start))
'MsgBox spExceptions.Count
End If
next
Reading Appointments In The Inbox
I writing a prog that works with incoming appointments, The only prob is that I can read appointment, the code Im using ignore appointments and reads only emails. I have had to use
Private Function Get_New_Appointment() As AppointmentItem
'This function goes and gets the new appointment and then returns it
'Saving constantly for having to go and get the appointment
MsgBox "lets get the new appointment"
Dim mapiNamespace As NameSpace
Dim fldInbox As MAPIFolder
Dim NewAppoint As AppointmentItem
'Get reference to the inbox
Set mapiNamespace = Application.GetNamespace("MAPI")
Set fldInbox = mapiNamespace.GetDefaultFolder(olFolderInbox)
'get the last recived item in the inbox
Set NewAppoint = fldInbox.Items(1)
Set Get_New_Appointment = NewAppoint
'Clean up
Set fldInbox = Nothing
Set NewAppoint = Nothing
End Function
Linking Contacts And Appointments Using VBA
I am still at this one and hope there is an Outlook programmer who can help.
This creates a simple Outlook Appointment and Contact. I would like to insert the contact information into the "Contacts" link in the Appointment.
Code:
Sub AddContact_Appointment()
Dim OutlookApp As Object
Set OutlookApp = CreateObject("Outlook.Application")
With OutlookApp.CreateItem(olContactItem)
.Save
.LastName = "Jones"
.FirstName = "Robert"
.Save
End With
With OutlookApp.CreateItem(olAppointmentItem)
.Start = Date & " 12:00 pm"
.End = Date & " 2:00 pm"
.Subject = "Meet with Robert Jones for lunch."
.Save
End With
End Sub
Export Appointments To Outlook
Is there a way to export date/time appointments from my A2K2 database to my outlook callendar?
What I have is a calendar of projects that have bid dates assigned to them. I would like to export the date, time and name of the project automatically to Outlook where I can manage the time required.
Any ideas?
Thanks!
Scott
Outlook Appointments/Tasks
Hey:
Does anyone know of a way to interface Excel and the above mentioned Outlook Items?
More so, can I use VBA on the Excel side to list tasks, appointments, show the calendars in Excel?
More more so, (if this is easier) can I mimic/emulate/or at least use the basic fields necessary to record Appointments/Tasks with an Excel User Form that would replicate the data to Outlook?
I'm really just looking for key VBA terms/Methods, etc, (pointing me in the direction of free on-line info./tutorials would be just as grand...
--Dodd
Recurring Outlook Appointments
In Outlook, when you try to delete a recurring appointment, it asks whether you want to delete one instance or all instances. Calling the Delete method for an AppointmentItem only deletes the instance. How can I delete all instances at once?
Calendaring Outlook Appointments With VB
I'm familiar with VB, but I'm not an expert. I modified this code so that I could calendar form items with VB. It works really well, but now I need to make sure another user's calendar is updated with the same information. I tried modifying the code to send as a vcalender item but i can't get around the security prompt (Outlook is trying to access your calendar....). If I display the appointment, then the user has to have interaction.
I need to do this quickly in the most unintrusive way possible. Can someone tell me how?
Here's the code:
Dim outobj As Outlook.Application
Dim outappt As Outlook.AppointmentItem
Dim oFwdItem As MailItem
Dim sSubject As String
Dim strBody As String
Set outobj = CreateObject("outlook.application")
Set outappt = outobj.CreateItem(olAppointmentItem)
With outappt
.Start = Me.NextActionDue
.AllDayEvent = True
.Subject = Me.NextAction & " due on " & Me.InternalFileNo
.Body = "Re: " & Me.Title
.Categories = "Patent Filings"
.ReminderMinutesBeforeStart = 20160
.ReminderSet = True
.Save
End With
' Release the Outlook object variable.
Set outobj = Nothing
' Set the AddedToOutlook flag, save the record, display a message.
Me.CalendarChk = True
Me.Refresh
DoCmd.RunCommand acCmdSaveRecord
MsgBox "This date has been calendared!"
Thanks
Adding Appointments On Top Of The Calendar
http://www.efamro.com/images/outlook.jpg
Code:
Dim olAppt As Outlook.AppointmentItem
With olAppt
.Body = "TEST"
.Start = exlSheet.Cells(iRow, 1)
.Subject = exlSheet.Cells(iRow, 2)
.ReminderSet = False
.Save
End With
i need the appointments to be added on the location where test and test2 are on the agenda. .Start contains just a date with no time. I'm adding more then one appointment and i cant have them all on 00:00 (When i give no time they are added @ 00:00).
How can i put the appointments on top of the calendar? working with outlook
A Salon Appointments Book - Help??
We're doing a project for our college Vb course and we are doing an application for a hair salon. we'd like to do an appointment book, with the different styists on one axis of a grid and the time on the other, then appointments booked in the grid. we haven't a notion where to start though!
could anyone help us out?
we need to know how from the start - what components would be necessary, how to get a new page of the book for each date, if we can have the appointments saved in access - etc
any good examples on-line?
please please help!
SQL Checking Appointments Between Dates
Here is my code for finding all appointments between two dates. These dates are the current date, whatever it might be, and the seconds is 7 days from the first date. (Basically all appointments in the next week)
The only problem is it doesnt work.
VB Code:
Dim TodayDate, WeekDate As Date TodayDate = Format(Now, "DD/MM/YYYY")WeekDate = Format(DateAdd("d", 7, Now), "DD/MM/YYYY") SQLTXT = "SELECT *" SQLTXT = SQLTXT + " From Booking" SQLTXT = SQLTXT + " WHERE [Date] BETWEEN #" & TodayDate & "# and #" & WeekDate & "#" Set MySearch = MyDatabase.OpenRecordset(SQLTXT) MySearch.MoveLast If Not MySearch.RecordCount = 0 Then MySearch.MoveLast MySearch.MoveFirst End If lblCurrentBookings.Caption = "There are currently " & MySearch.RecordCount & " bookings this week." MySearch.Close
If you have any ideas i would really appreciate it.
Thank you all
ILMV aka SQL's worst nightmare
Lotus Notes Appointments From VB
hi all
i m trying to post a calendar entry from VB6 application to Lotus Notes 6.5
but the entry is get posted in calendar, Drafts & Sent items
i need solution for that.
How Do I Create Groupwise Appointments In Vb
I need to create appointments for groupwise calendar. I am using groupwise api and can create appointments, but the appointments land only in my groupwise account even though I use another users name in send "To" area. I have the following code that seems to work (although written in foxpro, but is easy to translate to vb).
ng = CREATEOBJECT("NovellGroupwareSession")
gobj = ng.Login
msg=gobj.Calendar.Messages.Add('GW.MESSAGE.APPOINTMENT',3)
msg.fromtext=ALLTRIM(.cbo1.value)
msg.Subject=ALLTRIM(.e1.value)
msg.BodyText=ALLTRIM(.e1.value)+" due date is "+DTOC(.txtTc_duedate.value)
msg.NotifyWhenDeleted=0
msg.StartDate=DATETIME()
g = .txtTc_notify.value && notify date
msg.alarmtime=DTOT(g)+ 8 * 3600
msg.Place='Probation'
csendto='SOMEMAIL:'+ALLTRIM(.txtTc_email.value)
snd=msg.Recipients.Add(csendto,"NGW","0")
snd.Resolve()
RELEASE ng
Does any know how to get an appointment to land in designated persons groupwise? I've tried all resources exhaustively and can't seem to get anywhere. I've fundled through this far, and this is the last missing component.
thanks
Nick Patel
Outlook Calendar Appointments Sort
Hi, i would like to know if someone has an answer for this strange thing...
I have developed a vb application that gets the appointments of the Outlook calendar and show them on a word document automatically. All works perfect except that "sometimes" when i create a "recurring event" it is not shown in its correct place. Imagine that this is the word document generated:
Monday 07/21
08:45-09:15 Meeting (this is the recurring event)
11:00-12:00 Visit
01:00-02:00 Lunch
Tuesday 07/22
10:00-12:00 Go to shop
01:00-02:00 Lunch
08:45-09:15 Meeting (this is the recurring event, but it should appear in the order of the start time, in other words before the event "Go to shop")
This is the problem, it happens sometimes with some recurring events. Of course when i'm getting the appointments, i have a routine that sorts the events according to the start time order. I have been testing it and i have found that sometimes it does not sort just the recurring event correctly. This is my function:
Code:
Sub GetAppts(rangequery As String, myrange As Object)
Set olns = olap.GetNamespace("MAPI")
Set CurFolder = olap.ActiveExplorer.CurrentFolder
Set olappts = olap.ActiveExplorer.CurrentFolder
Set mycol = olappts.Items
mycol.IncludeRecurrences = True
mycol.Sort "[Start]"
Set myrange = mycol.Restrict(rangequery)
End Sub
* The rangequery defines the list of appointments to get from a specified week, and it receives the value of the following variable:
Code:
rquery$ = "[Start] >= """ & tdystart & """ and [Start] <= """ & tdyend & """"
This works fine since the list of appointments is correct. The only problem is the order (the sort)...
Hope someone has a clue.
Regards,
G I Z M
Microsoft Outlook Booking Appointments
Hi
I've created a program which books appointments for people but i was wondering how i would do this without including the creator so infact it makes appointment for someone else without including the outlook user in which the application is using. Just wondering if this is possible??
Thanks in advance.
Sending Appointments To Outlook Calender?
Hi There, My problem is that i made an app that assigns courses to instructors, after assigning i send an email with info about the courses they had, what i need is to also make "Reminders To Them" In Their Calendar notifying them about the courses dates & Time,
Example, :
Instructor "A" has a course On 20/8/2005 - 25/8/2005 @ 3:00 PM, i need to make a reminder on his calender on outlook to tell him this,
is there away,
I searched the forum and found alot of topics around that but really i didnt understand them
thanks in advance
Outlook Appointments && Notification To Attendees
I am trying to create appointments and place them in calendars of specified users. I am using the following code to generate an appointment. This creates an appointment ok and saves it in outlook of the machine my app is running on. However, it does not send notification to recipients or attendees.
Dim ol As New Outlook.Application()
Dim ns As Outlook.NameSpace
Dim appt As Outlook.AppointmentItemClass
' Return a reference to the MAPI layer.
ns = ol.GetNamespace("MAPI")
' Create a new mail message item.
appt = ol.CreateItem(Outlook.OlItemType.olAppointmentItem)
With appt
' Create a subject and add body text.
.Subject = "TW test appt"
.Body = "TEST"
' Set start and end time of the meeting and location.
.Start = Now.AddMinutes(2)
.MeetingStatus = Outlook.OlMeetingStatus.olMeeting
.Location = "Meeting Room 1"
' Invite the required attendees.
' These names will also be placed in the To field by default.
.RequiredAttendees = "d@thinkware.co.uk; c@thinkware.co.uk"
.Recipients.Add("David Copple")
' Turn the reminder on and set it for 1 minute prior.
.ReminderSet = True
.ReminderMinutesBeforeStart = 1
' Send the meeting request out.
.Send()
.Save()
End With
' Release memory.
ol = Nothing
ns = Nothing
appt = Nothing
If I just use .Save(), it does not send out notification. When I also use .Send() an error is raised 'object not found'
Cheers, David
OUTLOOK 2000 Appointments For Other Folks...
HELP!
I had written an appointment function for OUTLOOK 97 that allowed people to make appointments for our doctors on a form, then when closed it sent a reminder to the person (still works) and it also placed it into the Doctor's calendar that the form was opened from. Now, when we switched over to OUTLOOK 2000 (a year ago), it stopped working that way. Now, it saves the appointment into the folder of the person who has OUTLOOK open, rather than the calendar open (by someone with permissions obviously).
I have tried to use the GETSHAREDDEFAULTFOLDER, but I can't figure out how to save the appointment into someone elses folder without having to use the meeting request function. I need this to be seamless to the doctors, in that they see the appointment, but do not have to "accept" the meeting. Also, we avoid 10 messages emailed whenever someone accepts.
I will gladly accept any assistance on this that you can lend.
Gregg Gellman
Setting Outlook Appointments In MS ACCESS
I have a client who uses an ACCESS2002 database to hold accommodation reservations for many properties. I would like to advise owners of these bookings by sending a file via email that they can import into outlook. Conversly I would like the owners to send emails about reservations they may make that can be automatically imported into the Access database. Any suggestions on how to automate these steps from within the version of Visual Basic that is supplied with Access.
TIA
Sandy
Edited by - Snady on 5/28/2005 12:11:40 AM
Starting .exe-file After Closing Window Of Appointments
hello
when i close the window of appointments i'd like to have an exe-file opening.
i know how you can open an exe-file but it only has to open when the window is closed and only then.
how do i solve it?
please help me.
pc-er2920
Outlook Appointments 'The Search For Star(t)date'
I entcounter a problem with this peace of code.
I'm trying to search for startdate and change the whole object
with a new startdate, a new enddate, subject and a new body.
The thing errors on 'Set MyItem = MyFolder.Items.Find(FilterS)'
I've tried everything (I hope not everything, and you guys come with a sollution), like : changing the stringS with extra "'s
and some more, but I can't make it work!!!
It does works with: Set myItem = MyFolder.Items.Find("[Subject] = ""Appointment with T 'Pol""")
Here's my code:
Sub Test2()
Test "17-8-04 9:00:00", "17-8-04 8:00:00", "17-8-04 9:00:00", "Changed", "Changed"
End Sub
Sub Test(StartDate As Date, SDate As Date, EDate As Date, SubjectS As String, BodyS As String)
Dim myOlapp As Outlook.Application
Dim myNamespace As Outlook.NameSpace
Dim myRecipient As Recipient
Dim MyFolder As Outlook.MAPIFolder
Dim MyItem As Outlook.AppointmentItem
Dim Appointment As Object
Set myOlapp = CreateObject("Outlook.Application")
Set myNamespace = myOlapp.GetNamespace("MAPI")
Set myRecipient = myNamespace.CreateRecipient("Johnathan Archer")
myRecipient.Resolve
DoEvents
If myRecipient.Resolved Then
On Error GoTo Errorhandling
Set MyFolder = myNamespace.GetSharedDefaultFolder(myRecipient, olFolderCalendar)
Else: GoTo NotHere
End If
Dim FilterS As String
FilterS = "[Start] = " & StartDate
Set MyItem = MyFolder.Items.Find(FilterS)
With MyItem
.Start = SDate
.End = EDate
.Body = BodyS
.Subject = SubjectS
End With
Set MyItem = Nothing
Set MyFolder = Nothing
Set myolap = Nothing
Set myNamespace = Nothing
Set myRecipient = Nothing
Errorhandling:
Exit Sub
NotHere:
MsgBox "This name is not used in outlook!"
End Sub
AnyOne?
Please Review Code For Sending Appointments From Access
This code is intended to send an appointment. When I double click my command button,in Access 97, nothing happens, and the appointment that I am send to myself does not appear. Any ideas, here is the code:
Private Sub Command94_Click()
Dim objOutlook As New Outlook.Application
Dim objAppoint As Outlook.AppointmentItem
Set objAppoint = objOutlook.Session.GetDefaultFolder(olFolderCalendar).Items.Add
objAppoint.Recipients.Add "burgesse"
objAppoint.Subject = "Subject-test appointment"
objAppoint.Body = "test appointment body"
objAppoint.Location = "Test Location"
objAppoint.Start = "6/6/02 2:00 pm"
objAppoint.End = "6/6/02 3:00 pm"
objAppoint.Send
End Sub
Thanks
Read Appointments In Public Folder Calendar
Hi all!
I saw this example on how to grab the appointments from your local calendar. Can any one help me with grabbing the appointments from a public folder calendar? Any suggestions would be much appreciated.
Cheers!
Edited by - Maverick2004 on 11/6/2006 2:12:11 AM
Automation Of Copying Between Calendar Appointments In Outlook 2002
Ahem..
Anyone out there know of a VBA script that automates the process of copying an appointment from a calendar on an exchange server to a local calendar. Specifically appointments on specific days and times of the week (i.e. Tuesday 10:00 - 10:30, Tuesday 10:30 - 11:00, etc)
Any help appreciated.
Outlook Loop Making Duplicate Appointments When It Should Make 1
Hey everyone,
I'm having this strange problem with some code I wrote to automate making appointments when emails are moved to a certain folder.
If I select 1 email and move it to the folder, fine, it makes 1 appointment.
If I select 2 or more emails and move them to the folder, it makes 2 appointments for every email.
When I attempt to problemsolve by stepping through the code when I have added 2 at one time, it makes 1 appointment.
Does anybody have any clues why this code (see below) does this? I've already been over to OutlookCode.com and have not gotten any bites... Thanks, Hilfy
Edited to add versions, etc: Using VBA/Outlook 2003...
Code:
Option Explicit
Option Compare Text
Dim WithEvents TargetFolderItems As Items 'Event handler for Lab Reports folder
Dim WithEvents TargetFolderItems2 As Items 'Event handler for Pending Lab Cal folder
Dim nsDennis As NameSpace 'Namespace object
Dim olCalendar As Outlook.MAPIFolder 'calendar object
Private Sub Application_Startup()
Set nsDennis = Application.GetNamespace("MAPI")
Set TargetFolderItems = nsDennis.Folders("DWR PIM").Folders("Lab Reports").Items
Set TargetFolderItems2 = nsDennis.Folders("DWR PIM").Folders("Pending Lab Cal").Items
End Sub
Private Sub TargetFolderItems_ItemAdd(ByVal Item As Object)
Dim olApptLabRes As Outlook.AppointmentItem 'Lab Results Appointment Object
Dim olMailLabRes As Outlook.MailItem 'Lab Results email object
Dim x As Integer 'counter to loop through email in lab results folder
Dim strSubject As String 'Holds subject of email
Dim strLReport As String 'Lab report string with which to parse subject
Dim objRecip As Outlook.Recipient 'Outlook recipient object
Dim strMailbox As String 'holds name of mailbox whose calendar you want to use
Dim objCalFolder As Outlook.MAPIFolder 'Calendar object
Dim strDateReceived As String 'Hold received Date/Time from email
strMailbox = "Hilfy" 'Name of mailbox whose calendar you want to use
Set objRecip = nsDennis.CreateRecipient(strMailbox) 'Set recipient object to above string
strLReport = "*lab report*" 'Look for this string in subject
Set objCalFolder = nsDennis.GetSharedDefaultFolder(objRecip, olFolderCalendar) 'Set Calendar object
On Error Resume Next
If TargetFolderItems.Count > 0 Then 'if there are items in the folder, then process them
For x = TargetFolderItems.Count To 1 Step -1 'step through folder items from bottom up
If Item.Class = olMail Then 'is item email?
Set olMailLabRes = TargetFolderItems(x) 'set email object to current email
strSubject = olMailLabRes.Subject 'pick up email subject
strDateReceived = olMailLabRes.ReceivedTime 'pick up email received time
If Not objCalFolder Is Nothing Then 'make sure calendar object is set
If strSubject Like strLReport Then 'Make sure subject says Lab report
Set olApptLabRes = objCalFolder.Items.Add(olAppointmentItem) 'make new appointment in calendar for Lab Result
'fill out details about appointment
With olApptLabRes
.Subject = olMailLabRes.Subject
.Body = "Received by CHS on: " & strDateReceived & vbNewLine
.AllDayEvent = True
.Start = Date
.ReminderSet = False
.BusyStatus = olFree
End With
Call CopyAttachments(olMailLabRes, olApptLabRes) 'copy attachments to appointment
olApptLabRes.Close olSave
Else
End If
Else
End If
Else
End If
olMailLabRes.Delete
olMailLabRes = Nothing
olApptLabRes = Nothing
Next
Else
End If
'Clear all objects set in the sub
Set olApptLabRes = Nothing
Set olMailLabRes = Nothing
Set objCalFolder = Nothing
Set objRecip = Nothing
End Sub
Sub CopyAttachments(objSourceItem, objTargetItem)
Dim strPath As String
Dim objAtt As Outlook.Attachment
Dim strFile As String
strPath = "S:LabResults"
For Each objAtt In objSourceItem.Attachments
strFile = strPath & objAtt.FileName
objAtt.SaveAsFile strFile
objTargetItem.Attachments.Add strFile, , , objAtt.DisplayName
Next
End Sub
Reading Dates In The Calender (Appointments) Section Of POOM
Hi all,
I am wondering if I missing the obvious, but I have written a short app which reads the appointments within POOM, based on the [categories] (ie: birthday). I am pulling the date of these recurring events from the [Start] date, and what I have noticed is that this is the date that appears is the first episode of the event that occured - which means that as the year changes, the dates become out (ie: reading last year an event occured 9-10-2003, and this year it is listed as 10-10-2003????) I did a little experiment and found that the Find function, based on the catagory, returned the same result. SO...
How does one return simply that a certain event reoccurs on the same date each year???
Outlook Appointments - Adding Contacts And Making Private
K - got an app that creates contact and appointment items in microsoft outlook. So far the program runs smooth. What I would like to do now is two things:
1.) When you open the contact item, it will, at the very least, link to all the appropriate appointments. Or, it may include 'embedded' bodies of those appointments. Anything so that when you open the contact, you'll have quick and easy access to the information contained in the appointments. This should work Vice-Versa as well, so that you look at an appointment, and you'd have quick access to all the appropriate contacts.
2.) I want to be able to 'toggle' palm synchronization. Some of the users, use outlook as their palm desktop. So when they synch, it pulls EVERYTHING from their outlook. Well, once installed, my app is going to include a LOT of appointments and contacts, and I don't want the user to have their palm overloaded with taht info, if they are also using outlook for personal stuff etc. On the other hand, if their palm is entirely meant for this informatin, sych'ing isn't a problem
You guys are a GREAT resource, I hope you can help find solutions to these problems
**************************************
The sooner I fall behind, the more time I'll have to catch up!
If at first you don't succeed....destroy all evidence that you even tried!
Remember - Amateurs built the ark...
...professionals built the titanic.
Cos(Number As Double) As Double??
When i was lookin at the object browser, it said to do this Cos(Number As Double) As Double to get a #'s cosine, but it like dont work. whut they mean by number as double? if i wanted the cos of 24, would i do Cos(48) 48???????
Double Double Quotes
Can someone please tell me variations on this ...
if you need to display "Hello world" in a messagebox WITH the quotes, and :
Code:
msgbox chr(34) & "Hello World" & chr(34)
msgbox """Hello World"""
don't work, what's an alternative please ?
I know someones posted a way to do this with the ' character before, but I can't remember it
Cheers All !
Difficult: Sending Outlook Meeting Appointments To Outlook And Exchange
I've seen partially useful postings, but nothing clear enough to understand how to solve this problem.
Here's what I want to accomplish:
. my meeting application chooses a date and users (from a calendar and drop down list)
. the app then sends email to the list of people with the meeting info
When the outlook client receives the email they are prompted the normal way to add the meeting to their outlook. I don't want to rewrite exchange, just deliver mtg info.
Anyone with sample code or even a pointer to info on how I may solve this problem?
Thx!
|