重新发布:Outlook Express的附件可能吗? [英] Repost: Attachments to Outlook Express possible?

查看:47
本文介绍了重新发布:Outlook Express的附件可能吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


这是10月6日发布的消息的重新发布。

我得到的答案是关于MapiMessages.AttachmentIndex。

我想我需要MSMAPI32.OCX才能使用它。 (我的PC上没有这个文件)


我的newsaccount在昨天之前不再工作,所以我会再试一次。


问题是:

我知道可以用Access发送电子邮件,但也可以自动化附件吗?

问题已被问到很多我知道......

我搜索了谷歌,但*所有*答案都可以使用Outlook或商业应用程序?

所以我还没有能够实现自动化使用Outlook Express附件问题。

任何想法或新见解?

(使用Access''97或Access 2000)

>
TIA

Arno R

Hi all,

This is a repost of a message posted at october 6.
The answer I got was about MapiMessages.AttachmentIndex.
I think I need the MSMAPI32.OCX to use this. (I don''t have this file on my PC)

My newsaccount wasn''t working anymore until yesterday, so I''ll try again.

Question is:
I know it is possible to send email with Access, but can one also automate the attachments?
Question has been asked a lot I know...
I''ve searched Google but *all* answers that work use Outlook or commercial apps?
So I have not been able yet to automate the attachment-issue using Outlook Express.
Any ideas or ''new'' insight?
(Using Access ''97 or Access 2000)

TIA
Arno R

推荐答案

Arno,
$ b $你在电子邮件部分看过Tony Toews的网站了吗?我差不多好了b $ b肯定它全部都在那里。

http://www.granite.ab.ca/access/email.htm
Arno,
did you look on Tony Toews''site in the e-mail section? I''m almost
positive it''s all covered there.

http://www.granite.ab.ca/access/email.htm


Arno R < AR **************** @ tiscali.nl>写在

新闻:3f ******************** @ dreader2.news.tiscali。 nl:
"Arno R" <ar****************@tiscali.nl> wrote in
news:3f********************@dreader2.news.tiscali. nl:
大家好,

这是10月6日发布的消息的重新发布。
我得到的答案是关于MapiMessages.AttachmentIndex 。
我想我需要MSMAPI32.OCX才能使用它。 (我的电脑上没有这个文件)

我的新闻记录直到昨天才开始工作,所以我会再次尝试
。问题是:
我知道可以用Access发送电子邮件,但是还可以自动化附件吗?问题已被问到很多我知道...
我搜索了谷歌,但*所有*答案都可以使用Outlook或
商业应用程序?所以我还没有能够使用Outlook Express自动化
附件问题。任何想法或新见解?
(使用Access''97或Access 2000)

TIA
Arno R
Hi all,

This is a repost of a message posted at october 6.
The answer I got was about MapiMessages.AttachmentIndex.
I think I need the MSMAPI32.OCX to use this. (I don''t have this file on
my PC)

My newsaccount wasn''t working anymore until yesterday, so I''ll try
again.

Question is:
I know it is possible to send email with Access, but can one also
automate the attachments? Question has been asked a lot I know...
I''ve searched Google but *all* answers that work use Outlook or
commercial apps? So I have not been able yet to automate the
attachment-issue using Outlook Express. Any ideas or ''new'' insight?
(Using Access ''97 or Access 2000)

TIA
Arno R



此类应通过Outlook Express发送附件。但为什么? CDO是

更简单,更强大。


选项明确


私有类型MAPIRecip

保留为长

RecipClass As Long

名称字符串

地址字符串

EIDSize As Long

EntryID As String

结束类型


私有类型MAPIFileTag

保留为长

TagLength As Long

Tag()As Byte

EncodingLength As Long

编码()As Byte

结束类型


私有类型MAPIFile

保留为长

标志为长

位置一样长

PathName As String

FileName As String

FileType As Long

结束类型


私有类型MAPIMessage

保留为长

主题为字符串

NoteText为字符串

MessageType As String

DateReceived As String

ConversationID As String

Orig inator As Long

Flags As Long

RecipCount As Long

收件人为长

FileCount As Long

文件一样长

结束类型


私有声明功能MAPISendMail _

Lib" c:\ program files\outlook express\msoe.dll" (_

ByVal会话长,_

ByVal UIParam As Long,_

ByRef消息作为MAPIMessage,_

ByVal Flags As Long,_

ByVal保留为长)


私有Const MAPI_E_NO_LIBRARY = 999

私有Const MAPI_E_INVALID_PARAMETER = 998

私有Const MAPI_ORIG = 0

私有Const MAPI_TO = 1

私有Const MAPI_CC = 2

私有Const MAPI_BCC = 3

私有Const MAPI_UNREAD = 1

私有Const MAPI_RECEIPT_REQUESTED = 2

私有Const MAPI_SENT = 4


私有Const MAPI_LOGON_UI =& H1

私有Const MAPI_NEW_SESSION =& H2

私有Const MAPI_DIALOG =& H8

Private Const MAPI_UNREAD_ONLY =& H20

Private Const MAPI_ENVELOPE_ONLY =& H40

Private Const MAPI_PEEK =& H80

Private Const MAPI_GUARANTEE_FIFO =& H100

Private Const MAPI _BODY_AS_FILE =& H200

Private Const MAPI_AB_NOMODIFY =& H400

Private Const MAPI_SUPPRESS_ATTAch =& H800

Private Const MAPI_FORCE_DOWNLOAD =& H1000


Private Const MAPI_OLE =& H1

Private Const MAPI_OLE_STATIC =& H2

Dim mAf()作为MAPIFile

Dim mAr()作为MAPIRecip

Dim lAr As Long

Dim lAf As Long

Dim mM As MAPIMessage

Dim aErrors(0到26)As String


Private Sub Class_Initialize()

aErrors(0)=" Success"

aErrors(1)="用户中止>

aErrors(2)="失败>

aErrors(3)=" LogIn失败

aErrors(4)="磁盘已满

aErrors(5)="内存不足

aErrors(6) =阻止太小

aErrors(8)=太多会话

aErrors(9)=太多文件

aE rrors(10)=" Too Many Recipients"

aErrors(11)=" Attachment No Found"

aErrors(12)=" Attachment Open Failure"

aErrors(13)="附件写入失败

aErrors(14)="未知收件人

aErrors(15)=" ;坏收件人

aErrors(16)="没有消息"

aErrors(17)="无效消息"

aErrors( 18)=文字太大

aErrors(19)="无效会话"

aErrors(20)=" Type Not Suppported"

aErrors(21)="不明确的收件人'

aErrors(22)="正在使用的消息"

aErrors(23)="网络故障" ;

aErrors(24)="无效的编辑字段"

aErrors(25)="无效的收件人

aErrors(26) =不支持

End Sub


Public Sub BCCAddressAdd(ByVal strAddress As字符串)

RecipientAdd MAPI_BCC ,, strAddress

End Sub


Public Sub BCCNameAdd(ByVal strName As String)

RecipientAdd MAPI_BCC,strName

End Sub


Public Sub CCAddressAdd(ByVal strAddress As String)

RecipientAdd MAPI_CC, ,strAddress

End Sub


Public Sub CCNameAdd(ByVal strName As String)

RecipientAdd MAPI_CC,strName

End Sub


Public Sub MessageIs(ByVal strNoteText As String)

mM.NoteText = strNoteText

End Sub


Public Sub SubjectIs(ByVal strSubject As String)

mM.Subject = strSubject

End Sub

Public Sub ToAddressAdd(ByVal strAddress As String)

RecipientAdd MAPI_TO ,, strAddress

End Sub


Public Sub ToNameAdd(ByVal strName As String)

RecipientAdd MAPI_TO,strName

End Sub


Public Sub FileAdd (ByVal strPathName As String)

Dim f As MAPIFile

with f

.PathName = StrConv(strPathName,vbFromUnicode)

结束时

ReDim Preserve mAf(lAf)

mAf(lAf)= f

lAf = lAf + 1

End Sub


Public Sub Send()

Dim r As Long

含mM

如果lAf> 0然后

.FileCount = lAf

.Files = VarPtr(mAf(0))

结束如果

如果lAr> 0然后

.RecipCount = lAr

.Recipients = VarPtr(mAr(0))

r = MAPISendMail(0,0,mM,0 ,0)

如果r<> 0然后MsgBox aErrors(r)

结束如果

结束

结束子


私人Sub RecipientAdd(ByVal lngType As Long,_

可选ByVal strName As String,可选ByVal strAddress As String)

Dim r As MAPIRecip

r .RecipClass = lngType

如果strName<> ""然后r.Name = StrConv(strName,vbFromUnicode)

如果strAddress<> ""然后r.Address = StrConv(strAddress,

vbFromUnicode)ReDim Preserve mAr(lAr)

mAr(lAr)= r

lAr = lAr + 1

End Sub

-

Lyle

(电子邮件参考 http://ffdba.com/contacts.htm



This class should send attachments via Outlook Express. But WHY? CDO is
much simpler and much stronger.

Option Explicit

Private Type MAPIRecip
Reserved As Long
RecipClass As Long
Name As String
Address As String
EIDSize As Long
EntryID As String
End Type

Private Type MAPIFileTag
Reserved As Long
TagLength As Long
Tag() As Byte
EncodingLength As Long
Encoding() As Byte
End Type

Private Type MAPIFile
Reserved As Long
Flags As Long
Position As Long
PathName As String
FileName As String
FileType As Long
End Type

Private Type MAPIMessage
Reserved As Long
Subject As String
NoteText As String
MessageType As String
DateReceived As String
ConversationID As String
Originator As Long
Flags As Long
RecipCount As Long
Recipients As Long
FileCount As Long
Files As Long
End Type

Private Declare Function MAPISendMail _
Lib "c:\program files\outlook express\msoe.dll" ( _
ByVal Session As Long, _
ByVal UIParam As Long, _
ByRef message As MAPIMessage, _
ByVal Flags As Long, _
ByVal Reserved As Long) As Long

Private Const MAPI_E_NO_LIBRARY = 999
Private Const MAPI_E_INVALID_PARAMETER = 998

Private Const MAPI_ORIG = 0
Private Const MAPI_TO = 1
Private Const MAPI_CC = 2
Private Const MAPI_BCC = 3

Private Const MAPI_UNREAD = 1
Private Const MAPI_RECEIPT_REQUESTED = 2
Private Const MAPI_SENT = 4

Private Const MAPI_LOGON_UI = &H1
Private Const MAPI_NEW_SESSION = &H2
Private Const MAPI_DIALOG = &H8
Private Const MAPI_UNREAD_ONLY = &H20
Private Const MAPI_ENVELOPE_ONLY = &H40
Private Const MAPI_PEEK = &H80
Private Const MAPI_GUARANTEE_FIFO = &H100
Private Const MAPI_BODY_AS_FILE = &H200
Private Const MAPI_AB_NOMODIFY = &H400
Private Const MAPI_SUPPRESS_ATTAch = &H800
Private Const MAPI_FORCE_DOWNLOAD = &H1000

Private Const MAPI_OLE = &H1
Private Const MAPI_OLE_STATIC = &H2
Dim mAf() As MAPIFile
Dim mAr() As MAPIRecip
Dim lAr As Long
Dim lAf As Long
Dim mM As MAPIMessage
Dim aErrors(0 To 26) As String

Private Sub Class_Initialize()
aErrors(0) = "Success"
aErrors(1) = "User Abort"
aErrors(2) = "Failure"
aErrors(3) = "LogIn Failure"
aErrors(4) = "Disk Full"
aErrors(5) = "Insufficient Memory"
aErrors(6) = "Block Too Small"
aErrors(8) = "Too Many Sessions"
aErrors(9) = "Too Many Files"
aErrors(10) = "Too Many Recipients"
aErrors(11) = "Attachment No Found"
aErrors(12) = "Attachment Open Failure"
aErrors(13) = "Attachment Write Failure"
aErrors(14) = "Unknown Recipient"
aErrors(15) = "Bad Recipient"
aErrors(16) = "No Messages"
aErrors(17) = "Invalid Message"
aErrors(18) = "Text Too Large"
aErrors(19) = "Invalid Session"
aErrors(20) = "Type Not Suppported"
aErrors(21) = "Ambiguous Recipient"
aErrors(22) = "Message in Use"
aErrors(23) = "Network Failure"
aErrors(24) = "Invalid Edit Fields"
aErrors(25) = "Invalid Recipient"
aErrors(26) = "Not Supported"
End Sub

Public Sub BCCAddressAdd(ByVal strAddress As String)
RecipientAdd MAPI_BCC, , strAddress
End Sub

Public Sub BCCNameAdd(ByVal strName As String)
RecipientAdd MAPI_BCC, strName
End Sub

Public Sub CCAddressAdd(ByVal strAddress As String)
RecipientAdd MAPI_CC, , strAddress
End Sub

Public Sub CCNameAdd(ByVal strName As String)
RecipientAdd MAPI_CC, strName
End Sub

Public Sub MessageIs(ByVal strNoteText As String)
mM.NoteText = strNoteText
End Sub

Public Sub SubjectIs(ByVal strSubject As String)
mM.Subject = strSubject
End Sub

Public Sub ToAddressAdd(ByVal strAddress As String)
RecipientAdd MAPI_TO, , strAddress
End Sub

Public Sub ToNameAdd(ByVal strName As String)
RecipientAdd MAPI_TO, strName
End Sub

Public Sub FileAdd(ByVal strPathName As String)
Dim f As MAPIFile
With f
.PathName = StrConv(strPathName, vbFromUnicode)
End With
ReDim Preserve mAf(lAf)
mAf(lAf) = f
lAf = lAf + 1
End Sub

Public Sub Send()
Dim r As Long
With mM
If lAf > 0 Then
.FileCount = lAf
.Files = VarPtr(mAf(0))
End If
If lAr > 0 Then
.RecipCount = lAr
.Recipients = VarPtr(mAr(0))
r = MAPISendMail(0, 0, mM, 0, 0)
If r <> 0 Then MsgBox aErrors(r)
End If
End With
End Sub

Private Sub RecipientAdd(ByVal lngType As Long, _
Optional ByVal strName As String, Optional ByVal strAddress As String)
Dim r As MAPIRecip
r.RecipClass = lngType
If strName <> "" Then r.Name = StrConv(strName, vbFromUnicode)
If strAddress <> "" Then r.Address = StrConv(strAddress,
vbFromUnicode) ReDim Preserve mAr(lAr)
mAr(lAr) = r
lAr = lAr + 1
End Sub
--
Lyle
(for e-mail refer to http://ffdba.com/contacts.htm)


嗨Pieter,谢谢你的回复。


(我的新闻服务器再次无效@#
Hi Pieter, thanks for replying.

(Again my newsserver is not working @#


这篇关于重新发布:Outlook Express的附件可能吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆