-2

My project is to send fields before Visual Studio to Outlook Body in fields entered in the body after the reception of messages the user can modify the data sent in text fields on Outlook and sends the update data it will be saved in database that's possible to update data from outlook to Database ?

4

1 回答 1

0

我已经构建了一个这样的解决方案,我每天都使用它来阅读和归档邮件,作为我日常工作流程的一部分。但正如其他人所暗示的那样,您需要具体说明您需要帮助的内容。

        If (TypeOf olItem Is Outlook.MailItem) Then
            Dim olMailItem As Outlook.MailItem = TryCast(olItem, Outlook.MailItem)

            If olMailItem.Permission = Outlook.OlPermission.olUnrestricted Then
                strBody = olMailItem.HTMLBody                   'file:///C:/AttSave/header.png
            Else
                strBody = "Rights Protected fix if I'm not in debugger"
            End If

            For Each olAttach In olMailItem.Attachments
                If olAttach.Type <> Outlook.OlAttachmentType.olOLE Then
                    olAttach.SaveAsFile("c:\AttSave\" & olAttach.FileName)
                    'strBody = strBody.Replace("cid:header", "file:///C:/AttSave/header.png")
                    strCID = olAttach.PropertyAccessor.GetProperty("http://schemas.microsoft.com/mapi/proptag/0x3712001E")
                    If strCID <> "" Then
                        strBody = strBody.Replace("cid:" & strCID, "file:///C:/AttSave/" & System.Web.HttpUtility.UrlEncode(olAttach.FileName))
                    End If
                    lst_Attach.Items.Add(olAttach.FileName)
                Else
                    MsgBox("open this one via outlook")
                End If

            Next
            Me.webBody.DocumentText = strBody
            Me.txtSubject.Text = olMailItem.Subject
            If olMailItem.Importance = Outlook.OlImportance.olImportanceHigh Then
                Me.txtSubject.ForeColor = Color.Red
            Else
                Me.txtSubject.ForeColor = Color.White
            End If

            'Dim palSender As Microsoft.Office.Interop.Outlook.AddressEntry
            'palSender = mailItem.Sender
            Me.txtSentDate.Text = olMailItem.SentOn
            'Me.txtTo.Text = olMailItem.To
            olSenderA = olMailItem.Sender
            If IsNothing(olSenderA) = False Then

                'Dim olConItem As Outlook.ContactItem

                'olConItem = olSenderA.GetContact()
                'If Not IsNothing(olConItem) Then
                '    If olConItem.HasPicture = True Then
                '        Stop
                '    End If
                'End If


                Pa = olSenderA.PropertyAccessor
                'Debug.Print(olRe.Name & "stp= " & Pa.GetProperty("http://schemas.microsoft.com/mapi/proptag/0x39FE001E"))
                Try
                    Me.txtFrom.Text = Me.txtFrom.Text & olSenderA.Name & " (" & Pa.GetProperty("http://schemas.microsoft.com/mapi/proptag/0x39FE001E") & ")"
                Catch ex As System.Runtime.InteropServices.COMException
                    'Stop
                    Me.txtFrom.Text = olMailItem.SenderName & " (" & olMailItem.SenderEmailAddress & ")"
                Catch ex As Exception
                    Stop
                End Try
于 2013-07-22T20:37:33.993 回答