Outlook Meeting Attachment

  • Thread starter Thread starter Andy
  • Start date Start date
A

Andy

Using Outlook 98 and Access97:

I have sucessfully generated an Outlook Meeting request from Access, and set
the Start, Duration, Subject and Location parameters.

I would like to have a file included as an attachment. How do I set this
up?

Thanks,
Andy
 
Hi,
Use the Attachments collection of the Object you're using.
Are you using an ApppointmentItem?

Something like:

yourApptObject.Attachments.Add "C:\My Documents\Q496.xls", _
olByValue, 1, "4th Quarter 1996 Results Chart"

The syntax for the Add method is:

expression.Add(Source, Type, Position, DisplayName)

expression An expression that returns an Attachments object.

Source Required String. The file (represented by the full path and file name) or item that constitutes the attachment.

Type Optional Long. The type of attachment. Can be one of the following OlAttachmentType constants: olByReference, olByValue,
olEmbeddedItem, or olOLE.

Position Optional Long. The position of the attachment within the body text of the message.

DisplayName Optional String. The display name of the attachment.
 
Using a MeetingRequestItem.

Thanks for the info.Works great.

Dan Artuso said:
Hi,
Use the Attachments collection of the Object you're using.
Are you using an ApppointmentItem?

Something like:

yourApptObject.Attachments.Add "C:\My Documents\Q496.xls", _
olByValue, 1, "4th Quarter 1996 Results Chart"

The syntax for the Add method is:

expression.Add(Source, Type, Position, DisplayName)

expression An expression that returns an Attachments object.

Source Required String. The file (represented by the full path and file
name) or item that constitutes the attachment.
Type Optional Long. The type of attachment. Can be one of the following
OlAttachmentType constants: olByReference, olByValue,
 
One more question. Can I add an atachement as a text file vs inserting it as
a link or a file?

I have tried Attachment.Add filename, <0,1,2,3,4>, 1, DisplayName

All I get is either the file or a shortcut to the file.

Thanks,
Andy
 
Hi,
If you mean put the text in the body of the email, I'm not sure and Help
was no help to me on that one.
You could always open the file, put the text in a variable and then add that
to the body of the message.

Public Function FileIntoString(PathToFile As String) As String
Dim strFile As String
Dim strTemp As String
strFile = String(FileLen(strIn), " ")
Open strIn For Input As #1
Do While Not EOF(1)
Line Input #1, strTemp
strFile = strFile & strTemp
Loop

Close #1
FileIntoString = strFile
End Function
 
Your statement indicates that you have already
accomplished what I am trying to achieve, that is, sending
a Calendar item, e.g. Meeting details, to Outlook 98 from
Access 97. If this is so, would you mind supplying the
code that you used? In exchange, I use the following for
file attachments:

amongst the usual, set a var for
objOutlookAttach As Outlook.Attachment

Set objOutlook = CreateObject("Outlook.Application")
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
With objOutlookMsg
Set objOutlookRecipTo = .Recipients.Add(Forms!f_Purchases!
eMailTo) [or wherever you have the name stored]
objOutlookRecipTo.Type = olTo
objOutlookRecipTo.Resolve

Set objOutlookRecipCC = .Recipients.Add(Forms!f_Purchases!
ccEmailto) [--ditto--]
objOutlookRecipCC.Type = olCC
objOutlookRecipCC.Resolve

.Subject = MyStr3 [notated elsewhere in the code]
.Body = MyStr [ --ditto--]
.Attachments.Add (MyStr2) [--ditto--]
.Attachments.Add (MyStr4) [ a 2nd file --ditto--]
.Importance = olImportanceHigh

objOutlookMsg.Display [forces Outlook to wait before
sending]
Set objOutlook = Nothing
End With

I hope this is what you were looking for
Regards
Dave B.
 
Set objApplication = GetObject("Outlook Application")
Set objAppt=objApplication.createitem(1)
objAppt.MeetingStatus=1

You may also set location, duration, recipients, and Start.


hth,
Andy

David Brownstone said:
Your statement indicates that you have already
accomplished what I am trying to achieve, that is, sending
a Calendar item, e.g. Meeting details, to Outlook 98 from
Access 97. If this is so, would you mind supplying the
code that you used? In exchange, I use the following for
file attachments:

amongst the usual, set a var for
objOutlookAttach As Outlook.Attachment

Set objOutlook = CreateObject("Outlook.Application")
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
With objOutlookMsg
Set objOutlookRecipTo = .Recipients.Add(Forms!f_Purchases!
eMailTo) [or wherever you have the name stored]
objOutlookRecipTo.Type = olTo
objOutlookRecipTo.Resolve

Set objOutlookRecipCC = .Recipients.Add(Forms!f_Purchases!
ccEmailto) [--ditto--]
objOutlookRecipCC.Type = olCC
objOutlookRecipCC.Resolve

.Subject = MyStr3 [notated elsewhere in the code]
.Body = MyStr [ --ditto--]
.Attachments.Add (MyStr2) [--ditto--]
.Attachments.Add (MyStr4) [ a 2nd file --ditto--]
.Importance = olImportanceHigh

objOutlookMsg.Display [forces Outlook to wait before
sending]
Set objOutlook = Nothing
End With

I hope this is what you were looking for
Regards
Dave B.


-----Original Message-----
Using Outlook 98 and Access97:

I have sucessfully generated an Outlook Meeting request from Access, and set
the Start, Duration, Subject and Location parameters.

I would like to have a file included as an attachment. How do I set this
up?

Thanks,
Andy


.
 
Back
Top