# Re: 用VB寄有附件的信

Posted by 飞云 on April 08, 1999 at 14:18:12:

In Reply to: Re: 用VB寄有附件的信 posted by 飞云 on April 07, 1999 at 16:53:36:

那是因为你定了 mapimess1.compose 之后
又作了别的，以至于 mapimess1.msgindex 不等于 -1

又，你的信件内容字数比附件数少，所以当掉
试试这一个
sss% = Len(MAPIMess.MsgNoteText)
If sss% < AttCon% + 3 Then
MAPIMess.MsgNoteText = Str$(sss%) + String$(AttCon%, " ")
End If
'附件
If Val(mRS!att) Then
Set mRA = mDB.OpenRecordset("att", dbOpenDynaset)
'I = 0
Do Until mRA.EOF
If mRA!Id = Number$ Then
MAPIMess.AttachmentIndex = MAPIMess.AttachmentCount
MAPIMess.AttachmentName = mRA!attname
MAPIMess.AttachmentPathName = mRA!attpath 'DigAtt.filename
MAPIMess.AttachmentPosition = MAPIMess.AttachmentIndex
MAPIMess.AttachmentType = 0 'vbAttachTypeData
'I = I + 1
mRA.Delete
End If 'mrs!id
mRA.MoveNext
Loop
mRA.Close
End If
MAPIMess.Send

Follow Ups:

- Re: 用VB寄有附件的信 小猫 11:33:00 4/12/99 (0)