A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook - General Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Outlook not displaying attachment from Access via code



 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old February 27th 06, 03:26 AM posted to microsoft.public.outlook
[email protected]
external usenet poster
 
Posts: 5
Default Outlook not displaying attachment from Access via code

Hello all,

I hope you can assist.

I found a snipet of code on microsoft.public.access to send email from
Access, using
Redemption to get around the Outlook security warnings. All works
well, except for attaching a file. Or rather, I *thought* the file
wasn't getting attached.

Further testing indicates that the file does indeed get attached, but
when I preview the email to be sent, the attachment does not get
displayed. I am using Outlook 2002, and send all my mails in text
format.

Can anyone point me in the right direction to display the attachment?
I know I can tell by the size of the email if there is an attachment,
but my users need to be able to tell which file is being attached.

Thanks

++++

I select the file to attach via a dialogue box, which loads the full
path of the file to attach in txtPath.

Here's my variation on the code, could anyone explain why it won't
attach the files? And what I need to do to fix it?

Private Sub cmdAEGScience_Click()

Dim safemail As Variant
Dim myOlApp
Dim MyItem
Dim myRecipient
Dim myBody
Dim myfolder
Dim mynamespace
Dim myAttachments
Dim Utils
Dim strSendTo As String
Dim strCC As String
Dim strAttachPath As String
Dim strAttachPath2 As String
Dim AEGs As String

AEGs = "bla bla bla"

strSendTo = Me.cmbPaperCoord
strCC = Me.txtAddy & "
strAttachPath = Me.txtPath
'strAttachPath2 = "FullPathToFile"

Set myOlApp = CreateObject("Outlook.Application")
Set MyItem = myOlApp.CreateItem(0)
Set safemail = CreateObject("Redemption.SafeMailItem")
Set safemail.Item = MyItem
Set mynamespace = myOlApp.GetNamespace("MAPI")
'mynamespace.Logon "myProfile", "myPassword", True, True ' Choose a
Profile
Set myfolder = mynamespace.GetDefaultFolder(5)
With safemail
.Recipients.Add (strSendTo) ' Send To
.CC = strCC ' Carbon Copy
.Attachments.Add (strAttachPath) ' Attachment 1
'.Attachments.Add (strAttachPath2) ' Attachment 2
.Subject = "AEG - " & Me.txtStuLName & " - " & Me.txtStuID ' Email
Subject Text here
.Body = AEGs ' Text for Email Body
'.Importance = olImportanceHigh ' High importance
'.ReadReceiptRequested = True
.OriginatorDeliveryReportRequested = True
.Display
'.Send
End With

Set Utils = CreateObject("Redemption.MAPIUtils")
Utils.DeliverNow

Set myOlApp = Nothing
Set safemail = Nothing
Set Utils = Nothing
'MsgBox "Mail Sent", vbInformation, "Mail Sent..."

End Sub

 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
vcard not displaying the name contrain Outlook - General Queries 1 February 15th 06 05:55 PM
error code 0x80040155 Ekanson Outlook - General Queries 1 February 14th 06 02:15 AM
Selecting outlook account via code John Outlook - General Queries 2 January 16th 06 03:17 PM
Displaying from: in new email messages [email protected] Outlook - General Queries 0 January 8th 06 12:21 PM
Displaying from: in new email messages [email protected] Outlook - General Queries 0 January 8th 06 12:13 PM


All times are GMT +1. The time now is 01:38 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.