locked
Open outlook with certain Word template RRS feed

  • Question

  • SP 2007:

    Hi everyone,

    I just received an feature request, we are running Sharepoint 2007 here and they want to be able to click on a button in a person item and let the following things happen:

    • Set email recepient to Person's Email
    • Get certain Word template from a document library
    • Fill certain Word Fields from values in the Person item
    • Send mail or Open Outlook windows with result

    I was wondering if these things are possible, or which aren't? Is there a workaround?

    Regards,
    Tobias

    • Edited by Mike Walsh FIN Monday, February 28, 2011 12:00 PM SP 2007 - not needed in Title as default. But DO say in text whether MOSS 2007 or WSS 3.0
    Monday, February 28, 2011 10:37 AM

Answers

  • Hi Tobias,

    I am sorry for the misunderstanding....

     

     You can create an event handler on the Document Library hosting information with CVs and use the ItemUpdated event. So inside the Handler you can do:

    • Get certain Word template from a document library: You can link a field of the CVs Document Library with the templates Document Library. By doing this it is possible to access the right document template from the templates Document Lib based on this field.  
    • Fill certain Word Fields from values in the Person item:  Since you have person's fields in the event handler you can now update the bookmarks inside the document. For details on how to do this you can see here or here
    • Set email recipient to Person's Email / Send mail or Open Outlook windows with result: You can initialize an SMTP Client Object to send the email. During ItemUpdate event it is possible to retrieve information stored in any field of the item updated. Thus, you already know the recipient's address. You already have the template with updated bookmarks so you can attach the document to the SMTP Client. 

     

     

    An alternative to the above would be  to update only the bookmarks in the template related to the specific CV and let the sending mail with attachment action to an SPD workflow (http://spdactivities.codeplex.com/)  

    Monday, February 28, 2011 7:52 PM

All replies

  • The question here is where would this solution rely ?

    On SharePoint? on a custom application that uses information stored in SharePoint? An outlook plugin?  A SharePoint Field ?

    Where are these persons stored? In a list ?

     

    In order to send mail there are two options: 

    1. Send email by using SMTP (via code or Workflow or anything that uses SMTP class)

    2. create a link that opens outlook message (mailto): In this case it is not possible to attach items, get dynamic address etc..

     

    I think that most of the work you need to should be done by using code. A list event handler which is getting fired when you set a field in your list.  (In case your information is stored in a list..)

     

     

     

     

    Monday, February 28, 2011 11:02 AM
    • Preferably on SharePoint itself.
    • The persons are listed in a document library (based on a CV file)

    I think the problem will be the adjusting fields in a Word Template from Sharepoint, I don't believe it's possible?!

     

    Monday, February 28, 2011 12:00 PM
  • So, you have a single CSV document having Names or emails stored in Doc Library?

    What do you mean by adjusting fields? Filling some metadata or filling some content inside the document itself ?

     

     

    Monday, February 28, 2011 12:29 PM
  • So, you have a single CSV document having Names or emails stored in Doc Library?

    What do you mean by adjusting fields? Filling some metadata or filling some content inside the document itself ?

     

     


    No I have a document Library filled with Curriculum Vitaes(word or pdf documents)/ resumés, with some extra fields like person's name, address and so on.
    I also have a small document library containing Word Templates with bookmarks (fields in word predefined) and those will need to be filled out automatically based on information in the Persons document library. So content inside the document itself, working with Word from code.

    Monday, February 28, 2011 12:39 PM
  • Hi Tobias,

    I am sorry for the misunderstanding....

     

     You can create an event handler on the Document Library hosting information with CVs and use the ItemUpdated event. So inside the Handler you can do:

    • Get certain Word template from a document library: You can link a field of the CVs Document Library with the templates Document Library. By doing this it is possible to access the right document template from the templates Document Lib based on this field.  
    • Fill certain Word Fields from values in the Person item:  Since you have person's fields in the event handler you can now update the bookmarks inside the document. For details on how to do this you can see here or here
    • Set email recipient to Person's Email / Send mail or Open Outlook windows with result: You can initialize an SMTP Client Object to send the email. During ItemUpdate event it is possible to retrieve information stored in any field of the item updated. Thus, you already know the recipient's address. You already have the template with updated bookmarks so you can attach the document to the SMTP Client. 

     

     

    An alternative to the above would be  to update only the bookmarks in the template related to the specific CV and let the sending mail with attachment action to an SPD workflow (http://spdactivities.codeplex.com/)  

    Monday, February 28, 2011 7:52 PM
  • Thanks you very much, I will be trying that later today.
    Really appreciate your help!

    Tuesday, March 1, 2011 8:33 AM