[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.3

VBA and Lotus Notes: Using VBA to create Notes email with 2 (or more) attachments and have Notes open email for user edit before sending

Asked by Hammer8 in Visual Basic Programming, Lotus Notes, Lotus Domino Email Server

Tags: Lotus Notes, VBA, Excel

Hi, I am trying to write VBA code which will do the above.  I have search this site and many others looking for a solution, but have not been able to find one.  I am able to build the email and save it in the drafts folder, but cannot find a way to reference that document in UIWorkspace so I can edit it with EDITDOCUMENT.  I am getting the following error #4719 Incorrect argument type: object expected.

I have searched for days for a solution and found many others who have the same problem: which is trying to edit a "backend" document in UIWorkspace.  Is there a workaround to this?

An alternative to passing doc to  uiws.EDITDOCUMENT(True, doc) would be to some how select the document created which now sits in the Drafts folder and use uiws.EditDocument(True), but I also cannot figure out how to find and select the document created and saved by the VBA code.  

Thanks!  Hammer  
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:
Sub SendTradeEmailNotes(subject, too, cc, bcc, htmlpath, Tickers() As String)
    Dim session As Object
    Dim MailDb As Object
    Dim MailDoc As Object
    Dim oAttachME As Object
    Dim oEmbedObj As Object
 
    Dim uiWS As Object
    Dim uiDoc As Object
 
    Dim parent As NotesMIMEEntity
    Dim Child() As NotesMIMEEntity
    Dim header As NotesMIMEHeader
    Dim stream As NotesStream
    Dim doc As NotesDocument
    Dim collection As NotesDocumentCollection
    
    Dim View As NotesView
    Dim uiView As NOTESUIVIEW
    
    Dim i, j, X, Childs, response, lngError, rtitem, UNID
    
    Set session = CreateObject("Lotus.NotesSession")
    Call session.Initialize
 
    Set MailDb = session.GetDbDirectory("Accout").OpenMailDatabase
 
    If MailDb.IsOpen = True Then
        'Already open for mail
    Else
        Call MailDb.Open
    End If
 
    Set doc = MailDb.CreateDocument
    Call doc.ReplaceItemValue("Form", "Memo")
    Call doc.ReplaceItemValue("Subject", subject)
 
    ' Create all the Entities - one parent, X children depending on number of attachments
    Set parent = doc.CreateMIMEEntity
    
    Childs = UBound(Tickers()) + 1
    
    ReDim Child(1 To Childs)
    Set Child(1) = parent.CreateChildEntity
    
    ' Add a couple of headers to child 2 (that will hold the attachment).
 
    j = UBound(Tickers())
 
    For i = 1 To j
        ' Bring the attachment into its entity (child 2)
        Set stream = session.CreateStream
        If FileOrDirExists("C:\" & Tickers(j - i + 1) & " Trades.txt") Then
            Set Child(i + 1) = parent.CreateChildEntity(Child(i))
            
            Set header = Child(i + 1).CreateHeader("Content-Transfer-Encoding")
            Call header.SetHeaderVal("binary")
            Set header = Child(i + 1).CreateHeader("Content-Disposition")
            Call header.SetHeaderVal("attachment; filename=" & Tickers(j - i + 1) & " Trades.txt")
 
            X = stream.Open("C:\" & Tickers(j - i + 1) & " .txt", "binary")
            Call Child(i + 1).SetContentFromBytes(stream, "text/plain", ENC_NONE)
            Call Child(i + 1).EncodeContent(ENC_IDENTITY_8BIT)
            Call stream.Close
        End If
    Next i
    Call doc.AppendItemValue("Form", "Memo")
    doc.Save True, True
    UNID = doc.UniversalID
 
    Set uiWS = CreateObject("Notes.NotesUIWorkspace")
    Set uidoc = uiws.EDITDOCUMENT(True, doc)  '<---------------Error Here!!!
 
    X = Shell("C:\Program Files\Lotus\Notes\notes.exe", vbNormalFocus)
 
    Call uiDoc.GOTOFIELD("To")
    Call uiDoc.InsertText(too)
    
    Call uiDoc.GOTOFIELD("EnterCopyTo")
    Call uiDoc.InsertText(cc)
    
    Call uiDoc.GOTOFIELD("Subject")
    Call uiDoc.InsertText(subject)
    
    Call uiDoc.GOTOFIELD("Body")
    Call uiDoc.GOTOBOTTOM
    
    Call uiDoc.Import("HTML File", htmlpath)
    
    Call uiDoc.GOTOFIELD("Body")
    Call uiDoc.GOTOTOP
 
    Set doc = Nothing
 
    Set session = Nothing
    Set MailDb = Nothing
    Set MailDoc = Nothing
    Set oAttachME = Nothing
    Set oEmbedObj = Nothing
    Set uiWS = Nothing
    Set uiDoc = Nothing
 
End Sub
[+][-]01/02/09 01:04 AM, ID: 23278101Expert Comment

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 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01/02/09 04:31 AM, ID: 23278908Author Comment

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 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01/02/09 04:46 AM, ID: 23278957Expert Comment

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 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01/02/09 07:52 AM, ID: 23280154Author Comment

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 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01/02/09 08:12 AM, ID: 23280286Expert Comment

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 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01/02/09 08:44 AM, ID: 23280532Expert Comment

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 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01/02/09 08:49 AM, ID: 23280584Expert Comment

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 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01/02/09 09:09 AM, ID: 23280772Expert Comment

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 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01/02/09 09:12 AM, ID: 23280793Author Comment

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 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01/02/09 09:19 AM, ID: 23280842Expert Comment

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 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01/02/09 09:35 AM, ID: 23280970Author Comment

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 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01/02/09 09:44 AM, ID: 23281069Accepted Solution

View this solution now by starting your 30-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

Zones: Visual Basic Programming, Lotus Notes, Lotus Domino Email Server
Tags: Lotus Notes, VBA, Excel
Sign Up Now!
Solution Provided By: Bill-Hanson
Participating Experts: 2
Solution Grade: A
 
[+][-]01/02/09 09:46 AM, ID: 23281089Expert Comment

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 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01/02/09 09:53 AM, ID: 23281149Expert Comment

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 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01/02/09 09:56 AM, ID: 23281170Author Comment

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 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01/02/09 09:56 AM, ID: 23281172Expert Comment

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 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01/02/09 09:59 AM, ID: 23281198Expert Comment

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 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01/02/09 09:59 AM, ID: 23281204Author Comment

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 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01/02/09 10:00 AM, ID: 23281217Expert Comment

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 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01/02/09 10:02 AM, ID: 23281231Expert Comment

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 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01/02/09 10:12 AM, ID: 23281297Expert Comment

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 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01/02/09 10:14 AM, ID: 23281306Author Comment

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 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01/02/09 11:49 AM, ID: 23281933Author Comment

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 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01/02/09 01:00 PM, ID: 23282360Expert Comment

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 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01/02/09 02:27 PM, ID: 23282830Expert Comment

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 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01/03/09 01:34 PM, ID: 23287134Author Comment

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 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01/03/09 01:35 PM, ID: 23287148Author Comment

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 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01/05/09 06:15 AM, ID: 23295429Expert Comment

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 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01/05/09 06:49 AM, ID: 23295704Author Comment

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 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01/05/09 07:33 AM, ID: 23296098Expert Comment

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 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01/05/09 08:03 AM, ID: 23296377Author Comment

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 30-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-89 - Hierarchy / EE_QW_3_20080625