automating outlook via access

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi everyone.

I am new to Access and need help:

I would like to create 2 push buttons:
One to open outlooks calender and then let me set an appointment and appear
in the Access form,
Second to send the current form as is (not xml data) by outlook email.

If your reply includes scripts, please advise how to use them.

thanx very much!
 
As to the Code, roughly...

Dim objOutlook as Object
Dim newAppointment As Object

Set objOutlook = CreateObject("Outlook.Application")
'The CreateItem method creates the particular type of item needed
'1 represents an AppointmentItem. For the other values, check Outlook
'VBA help under CreateItem or constants
Set newAppt = objOutlook.CreateItem(1)

With newAppt
.Start = [value]
.Date = [value]
.Location = [value]
.Subject = [value]
.Body = [value]
.Save
.Display
end with

objOutlook.quit

Set newAppt = Nothing
Set objOutlook = Nothing

I've list a handful of the various properties for the AppointItem here.
Again, check the Outlook Object Model in Outlook VBA HELP for more.

Now, as to the other question about sending the form as-is - Do you mean
the Outlook Appointment Form or the Access Form? I don't believe that
its possible to send an Access Form via email.

David H
 
Hi Ofer.
I've seen your replies in other forums and tried to use it. i need to copy
these buttons into my on form, and it don't work.
how can i paste them into the form I created so they function properly?

"Ofer":
 
Just copying the button wont do the trick.
Follow this stages
1. Create a button in your form
2. Open the example mdb, right click on the button, and select code view
3. Copy the code from the Sub .... to End Sub
4. Right click on the button you created (in 1), select code.
5. Paste the code you copied (in 3)

Now, you might need to add reference to Microsoft OutLook.
Open code (any where), from the menu bar select Tools > reference
Add from the list Microsoft OutLook
 
Ofer, I am sorry but I don't get it.
I\m trying to copy the code from the buttons you suggested on the first reply.
I understand exactly nothing from what is going on there. is there a simpler
way???

"Ofer":
 
Sorry!
I managed to do it following your tips and Pworking around" a little.
Thank you so much for your help :)

"יו×ב ברזילי":
 
A simple way to send email, will be

Docmd.SendObject
acSendForm,"FormName",acFormatHtml,"(e-mail address removed)",,,"Enter subject"
 
It sounds as if you may need to do some homework to become more familar
with Visual Basic for Applications. I would *HIGHLY* recommend that you
snoop around Amazon.com or a local bookstore for a book on VBA. I would
start looking for books published by SYBEX as I've had great luck with
them. We can help, but there is a base level of knowledge required to
first properly ask a question, second to properly understand the
response and third to apply & improvise our input to your specific
situation. You will find that reading up on VBA and writting code
yourself will be well worth the investment.
 
Back
Top