Path to attachment - InfoPath Dev
in

InfoPath Dev

Path to attachment

Last post 01-20-2009 09:24 AM by kanishkajain. 0 replies.
Page 1 of 1 (1 items)
Sort Posts: Previous Next
  • 01-20-2009 09:24 AM

    Path to attachment

    The solution to this might be so simple that I didn't think about it, but after researching everywhere on this site and google and not finding the answer, I finally decided to post my question.

     

    Here is what I am trying to do. I have a form where I let the user enter an email address and attach a file and on clicking a "Send" button, I want to send out an email using Lotus Notes. Now, I have the "sending an email from Lotus Notes" part figured out. What I can't figure out is how to extract the directory path of the attached file, so I can attach it to the email. I am doing all this using JScript code:

     function CTRL5_5::OnClick(eventObj)
    {
            
        var strTo = XDocument.DOM.selectSingleNode("/my:myFields/my:field1").text;
        var strCC ="";
             
        var strBCC = "";
        //var strCC = XDocument.DOM.selectSingleNode("/my:myFields/my:PDRAS_ID").text;
        var strSubject = "PV Info";
        var emailmessage = XDocument.DOM.selectSingleNode("/my:myFields/my:field2").text;
        if(strTo != "")
        {
        sendNotesMail(strTo, strCC, strBCC, strSubject, emailmessage);
        }
        
        //Application.ActiveWindow.Close(true);*/
        
    }

    function sendNotesMail(strTo, strCC, strBCC, strSubject, emailmessage)
    {
        var domSession;
        domSession = new ActiveXObject("Lotus.NotesSession");     
        var domNotesDatabaseMailFile;
        var domNotesDocumentMemo;
        var domNotesRichTextItemBody;    
        domSession.Initialize();
        dbdir = domSession.getDbDirectory("");     
        domNotesDatabaseMailFile = dbdir.openMailDatabase();     
        domNotesDocumentMemo = domNotesDatabaseMailFile.createDocument();
        domNotesDocumentMemo.appendItemValue("Form", "Memo");
        domNotesDocumentMemo.appendItemValue("From", domSession.CommonUserName);
        domNotesDocumentMemo.appendItemValue("SendTo", strTo);    
        domNotesDocumentMemo.appendItemValue("CopyTo", strCC);
        domNotesDocumentMemo.appendItemValue("BlindCopyTo", strBCC);     
        domNotesDocumentMemo.appendItemValue("Subject", strSubject);
        domNotesRichTextItemBody = domNotesDocumentMemo.createRichTextItem("Body");     
        
        domNotesRichTextItemBody.appendText(emailmessage);
        domNotesRichTextItemBody.EmbedObject(1454, "", NEED FILE ATTACHMENT PATH HERE);
        
        domNotesDocumentMemo.Save(true, false);
        domNotesDocumentMemo.Send(false);
        
    }

     

    My attachment is at path "my:myFields/my:group1/my:group2/my:field3".

     

    Any help would be greatly appreciated. As I said, the solution could be very simple.

     

Page 1 of 1 (1 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.