Advertisement

07.13.2008 at 10:38AM PDT, ID: 23561021
[x]
Attachment Details

Download olemsg32.dll

Asked by athayes in Visual Basic Programming

Tags: Microsoft, Visual Basic, 6.0, Visual Ba

I am trying to send text from a RichText Box with MAPI.  I down loaded a project called VBMAPRTF but when I try to run it I am told that I am missing Microsoft Active Messaging 1.1.  After searching I find that this should be included in OLEMGS32.dll.  I cannot find how to get a copy.  I do not have Exchange Server 5 which is identified as a source.  Any assistance would be a hugh help.  The project as downloaded did not have the MAPI component checked.  Unfortunately checking it did not make any change.Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
Option Explicit
Public oSession As Mapi.Session  ****Can't find project or library
Public oMessage As Mapi.Message
Public oRecip As Mapi.Recipient
Public MessageID As String
 
Private Sub Form_Load()
    Set oSession = CreateObject("MAPI.Session")
    If oSession Is Nothing Then
        MsgBox "Could not create Mapi Session", vbOKOnly, "VBSendRTF"
        End
    End If
    oSession.Logon
    CreateNewMessage
End Sub
Private Sub Form_UnLoad(Cancel As Integer)
    If Not oMessage Is Nothing Then
        oMessage.Delete
        Set oMessage = Nothing
    End If
    If Not oSession Is Nothing Then
        oSession.Logoff
        Set oSession = Nothing
    End If
End Sub
Private Sub cmdBold_Click()
    RTFMessage.SelBold = Not RTFMessage.SelBold
    RTFMessage.SetFocus
End Sub
 
Private Sub cmdItalic_Click()
    RTFMessage.SelItalic = Not RTFMessage.SelItalic
    RTFMessage.SetFocus
End Sub
Private Sub cmdSendMessage_Click()
    Dim oMsgFilter As Mapi.MessageFilter
    Dim bRet As Integer
    
    'Set Subject
    oMessage.Subject = txtSubject.Text
    
    'Verify Recipient specified
    If IsEmpty(txtSendTo.Text) Then
        MsgBox "Please specify email name in 'Send To' text box", vbOKOnly, "VBSendRTF"
        Return
    End If
    'Set Recipient
    Set oRecip = oMessage.Recipients.Add
    oRecip.Name = txtSendTo.Text
    oRecip.Type = ActMsgTo
    oRecip.Resolve
  
    'Save the message
    oMessage.Update
 
    'Set the RTF property
    bRet = WriteRTF(oSession.Name, oMessage.ID, _
                    oMessage.StoreID, RTFMessage.TextRTF)
    If Not bRet = 0 Then
        MsgBox "RTF Property not stored successfully!", vbOKOnly, "VBSendRTF Warning"
    End If
    
    ' Retrieve the message again, now that it has changed
    Set oMessage = Nothing
    Set oMsgFilter = oSession.Outbox.Messages.Filter
    oMsgFilter.Fields(ActMsgPR_ENTRYID) = MessageID
    Set oMessage = oSession.Outbox.Messages.GetFirst
    
    ' Clear the Message Filters
    Set oMsgFilter = Nothing
    Set oSession.Outbox.Messages.Filter = Nothing
    
    ' Send the message
    oMessage.Send
    MsgBox "Message Sent"
    CreateNewMessage
End Sub
Sub CreateNewMessage()
    Set oMessage = oSession.Outbox.Messages.Add
    If oMessage Is Nothing Then
        MsgBox "Could not create Message", vbOKOnly, "VBSendRTF"
        End
    End If
    oMessage.Update
    MessageID = oMessage.ID
    RTFMessage.Text = "Message"
    txtSubject.Text = "Subject"
    txtSendTo.Text = "EmailName"
End Sub
 
Private Sub cmdCopyMessage_Click()
    Dim oMsgFilter As Mapi.MessageFilter
    Dim bRet As Integer
    Dim MsgRTF As String
    
    'Set Subject
    Dim oSrcMessage As Message
    Set oSrcMessage = oSession.Inbox.Messages(1)
    
    'Save the message
    oSrcMessage.Update
    
    ' Initialize the variable before passing it to the DLL
    ' The length of this variable will be the maximum length returned by the DLL
    MsgRTF = Space(5000)
    
    'Set the RTF property
    bRet = ReadRTF(oSession.Name, oSrcMessage.ID, _
                    oSrcMessage.StoreID, MsgRTF)
                    
    If Not bRet = 0 Then
        MsgBox "RTF Property not copied successfully!" & Chr(13) _
            & "Error: " & Hex$(bRet), vbOKOnly, "VBMapiRTF Warning"
    Else
        RTFMessage.TextRTF = MsgRTF ' Show the text in our RichEdit control
    End If
    
    txtSubject.Text = oSrcMessage.Subject
    
    Set oSrcMessage = Nothing
End Sub
 
Loading Advertisement...
 
[+][-]07.14.2008 at 07:09AM PDT, ID: 21998136

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.14.2008 at 08:13AM PDT, ID: 21998774

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.15.2008 at 05:47AM PDT, ID: 22006330

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.15.2008 at 06:07AM PDT, ID: 22006508

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.16.2008 at 01:56AM PDT, ID: 22014255

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.16.2008 at 06:15AM PDT, ID: 22015539

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Visual Basic Programming
Tags: Microsoft, Visual Basic, 6.0, Visual Ba
Sign Up Now!
Solution Provided By: TRobinJames
Participating Experts: 2
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628