Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / January 2005

Tip: Looking for answers? Try searching our database.

problem coding an attachment to an e-mail

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ray - 31 Jan 2005 15:22 GMT
Hi

I have been trying to modify some code I picked up from
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dno2k3ta/html/o
dc_ac_olauto.asp


I am uing Office 2003

I have modified most of it to run referencing my form but the attachment
section doesn't work properly. I hope someone can help me

The original code section is as follows

     ' Add attachments to the message.
     If Not IsMissing(AttachmentPath) Then
        Set objOutlookAttach = .Attachments.Add(AttachmentPath)
     End If

When I first tested the code as the web article suggested it worked fine but
now that I have modified it to read from my form it doesn't work

     ' Add attachments to the message.
     If Not IsNull([fsfrSupportersMessage].[Form]![fAttachment]) Then
        Set objOutlookAttach =
.Attachments.Add([fsfrSupportersMessage].[Form]![fAttachment])
     End If

No matter what I try objOutlookAttach always show as being
"objOutlookAttach = Nothing" Yet when I point at
([fsfrSupportersMessage].[Form]![fAttachment]) the correct path is reported.

The error message reads "438 Object doesn't support this property or method"

Please I am confused and can't seem to see my way forward on this one. Any
help would be very much appreciated.

Ray
visdev1 - 31 Jan 2005 21:11 GMT
For testing purposes, i would leave the original code alone and change the
value of the existing variables with my data.

AttachmentPath = [fsfrSupportersMessage].[Form]![fAttachment]
' or u could try this:
AttachmentPath = me.fAttachment
' now test to see if the data is valid
stop
     If Not IsMissing(AttachmentPath) Then
        Set objOutlookAttach = .Attachments.Add(AttachmentPath)
     End If

> Hi
>
[quoted text clipped - 32 lines]
>
> Ray
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.