Single appointment from Access to Outlook

  • Thread starter Thread starter Bruno Campanini
  • Start date Start date
B

Bruno Campanini

I'm able to send a single appointment from inside Access to Outlook.
This is the core code:

With OutAppt
.Subject = [Nominativo_Paziente]
.Start = [DataInizio] & " " & [OraInizio]
.End = [DataFine] & " " & [OraFine]
.FormDescription = [DescrizioniVarie]
.Location = [Nominativo_Medico]
.ReminderSet = False
.Save
End With

How can I tell him to "Replace duplicates with items imported"?

Bruno
 
What do you consider a duplicate?
It is your responsibility to check that a duplicate appointment (whatever
your definition is) already exists and delete it (or update instead of
creatign a new one).
See MAPIFolder.Find/FindNext/Restrict.

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
 
Tell who?

If you want a message in the appointment you can add it to the Body
property. But users won't see that unless they actually look at the item
when it's open.

To check for dupes in the code you'd need to write code to search the
calendar folder looking for appointments that begin on the same day and
time. Of course that does nothing for other appointments that might conflict
with the ones you add.

Outlook itself won't care how many dupes you create.
 
Dmitry Streblechenko said:
What do you consider a duplicate?

Two appointments with the same StartDate and StartTime.
It is your responsibility to check that a duplicate appointment (whatever
your definition is) already exists and delete it (or update instead of
creatign a new one).
See MAPIFolder.Find/FindNext/Restrict.

If I import manually with File => Import/Export/ etc...
there is a box I can check to "Replace duplicates with
items imported".

I immagine there is a flag I can set to get the same behaviour
programmatically.
Otherwise I have only the chance to delete duplicates from
within Outlook after import operation.

Bruno
 
Ken Slovak - said:
Tell who?

If you want a message in the appointment you can add it to the Body
property. But users won't see that unless they actually look at the item
when it's open.

To check for dupes in the code you'd need to write code to search the
calendar folder looking for appointments that begin on the same day and
time. Of course that does nothing for other appointments that might
conflict with the ones you add.

I did so then!
Outlook itself won't care how many dupes you create.

But i does importing manually via File => Import/Export ...
(see my reply to Dmitry).

Bruno
 
And Outlook assumes that if you use code you don't want UI popups coming up
to the user, it's your responsibility to check for dupes if you add
appointments, contact or whatever using code.
 
No such flag, it's your responsibility to check in your code. You do not
have to add first and then check. Just check for dupes before you add the
item.
 
What if you modify the start date and then want to export the changes to
Outlook when you already that appointment exported?
If you use Start as the only duplicate criteria, you will end up with a
duplicate.

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
 
Dmitry Streblechenko said:
What if you modify the start date and then want to export the changes to
Outlook when you already that appointment exported?
If you use Start as the only duplicate criteria, you will end up with a
duplicate.

I've ended this way:
1 - From within Outlook I programmatically delete all duplicates
(entries with the same Start)
2 - From within Outlook:
a - I load into a Collection all Calendar entries (Key:= Cstr(Start)).
b - from the external Access table I load into Calendar only
non-duplicates (filtering thru the Collection), while duplicates
are written into another external Access table.

Then I think I've all the scenario under control.

Bruno

PS
Arrrrrgh!
Unable to get Hourglass MousePointer...
Which is so easy with Access: DoCmd.Hourglass True
 
Back
Top