Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General MS InfoPath Questions / March 2006

Tip: Looking for answers? Try searching our database.

email addresses from sharepoint list

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ted - 02 Mar 2006 18:25 GMT
I am trying to modify the default issue tracking formso that when you click
the send as email button the form will gather the email addresses from a
sharepoint list.

I am not a programmer so I am not sure how to do this.
Kalyan Reddy - 02 Mar 2006 19:15 GMT
Hi Ted,

I Hope the link below might be of some help to yo
http://www.infopathdev.com/forums/topic.asp?TOPIC_ID=1540&SearchTerms=emails,fro
m,sharepoint,list


Signature

Kalyan Reddy
Visit http://www.autonomysystems.com

> I am trying to modify the default issue tracking formso that when you click
> the send as email button the form will gather the email addresses from a
> sharepoint list.
>
> I am not a programmer so I am not sure how to do this.
Ted - 02 Mar 2006 21:49 GMT
Kalyan,
Most of that is foreign to me. Here is my code. Maybe someone can help me
figure out how to modify it.
function SendEmailBtn::OnClick(oEvent)
{
    createEmail();
}

function createEmail()
{
    var xmlContributors =
XDocument.DOM.selectNodes("/iss:issue/iss:contributors/iss:contributor");
    var xmlContributor;
    var xmlTitle = XDocument.DOM.selectSingleNode("/iss:issue/iss:title");
    var rgRecipients = new Array();

    while (xmlContributor = xmlContributors.nextNode())
        rgRecipients.push(getNodeValue(xmlContributor.selectSingleNode("iss:emailAddressPrimary")));

    try
        {
        var oEnvelope = XDocument.View.Window.MailEnvelope;

        oEnvelope.To = rgRecipients.join("; ");
        oEnvelope.Subject = getNodeValue(xmlTitle);
        oEnvelope.Visible = true;
        }
    catch (ex)
        {
        XDocument.UI.Alert(ex.description);
        }
}

> Hi Ted,
>
[quoted text clipped - 6 lines]
> >
> > I am not a programmer so I am not sure how to do this.
S.Y.M. Wong-A-Ton - 03 Mar 2006 09:10 GMT
Do you have a SharePoint list as a Data Connection in your form? If you do,
it's just a matter of looping through all the email addresses in the list,
and composing a string by joining the email addresses with a semi-colon and
then using this string in the "To" field of your email message.
---
S.Y.M. Wong-A-Ton

> I am trying to modify the default issue tracking formso that when you click
> the send as email button the form will gather the email addresses from a
> sharepoint list.
>
> I am not a programmer so I am not sure how to do this.
Ted - 03 Mar 2006 13:20 GMT
I do have a sharepoint list as a data connection. I am not sure how to loop
thgough the addresses and show to create the string or where to put it once
it is created. I see the to field in the code but not sure how to modify it
to make it loop the addresses from the list. How would I modify the code
below.

function createEmail()
{
    var xmlContributors =
XDocument.DOM.selectNodes("/iss:issue/iss:contributors/iss:contributor");
    var xmlContributor;
    var xmlTitle = XDocument.DOM.selectSingleNode("/iss:issue/iss:title");
    var rgRecipients = new Array();

    while (xmlContributor = xmlContributors.nextNode())
        rgRecipients.push(getNodeValue(xmlContributor.selectSingleNode("iss:emailAddressPrimary")));

    try
        {
        var oEnvelope = XDocument.View.Window.MailEnvelope;

        oEnvelope.To = rgRecipients.join("; ");
        oEnvelope.Subject = getNodeValue(xmlTitle);
        oEnvelope.Visible = true;
        }
    catch (ex)
        {
        XDocument.UI.Alert(ex.description);
        }

> Do you have a SharePoint list as a Data Connection in your form? If you do,
> it's just a matter of looping through all the email addresses in the list,
[quoted text clipped - 8 lines]
> >
> > I am not a programmer so I am not sure how to do this.
S.Y.M. Wong-A-Ton - 03 Mar 2006 14:01 GMT
You need to take this one step at a time. Start by trying to get to the data
stored in your SharePoint data connection. Add something like the following
code at the beginning of the function:

var objSPSList =
XDocument.DataObjects["<Your_SharePoint_List_Data_Connection_Name>"].DOM;

XDocument.UI.Alert(objSPSList.xml);

What does the last line return?

---
S.Y.M. Wong-A-Ton

> I do have a sharepoint list as a data connection. I am not sure how to loop
> thgough the addresses and show to create the string or where to put it once
[quoted text clipped - 38 lines]
> > >
> > > I am not a programmer so I am not sure how to do this.
Ted - 03 Mar 2006 16:15 GMT
I managed to get the emails to pull from a list on a sharepoint list but it
sends the file as an attachment. I want the form to be included in the body
of the message. How can I accomplish this?

> You need to take this one step at a time. Start by trying to get to the data
> stored in your SharePoint data connection. Add something like the following
[quoted text clipped - 52 lines]
> > > >
> > > > I am not a programmer so I am not sure how to do this.
S.Y.M. Wong-A-Ton - 04 Mar 2006 16:37 GMT
Currently not a feature in InfoPath, but will be available in next version
(see http://blogs.msdn.com/tudort/archive/2006/02/22/536800.aspx).

You can send the plain XML of the form in the Body of the message by setting
the Intro property on the EmailAdapter (see
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ipsdk/html/xdob
jEmailAdapterObject_HV01106499.asp
)
to XDocument.DOM.xml. I don't think the MailEnvelope object (as in your code)
supports this property.
---
S.Y.M. Wong-A-Ton

> I managed to get the emails to pull from a list on a sharepoint list but it
> sends the file as an attachment. I want the form to be included in the body
[quoted text clipped - 56 lines]
> > > > >
> > > > > I am not a programmer so I am not sure how to do this.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.