none
Fill Outlook 2010 Quick parts based on SharePoint 2010 values RRS feed

  • Question

  • I have connected SharePoint 2010 discussion board to Outlook 2010. I have built an add-in for Outlook 2010 which has a custom adjoining form region for Post item. I have few combo boxes in form region which pulls information from SharePoint 2010 using .net managed client object model. I have few templates stored in Outlook quick parts.

    1. Based on user selection on one of the combo box can I filter the quick parts. One simple way i can think of is to create same set of combo box values into quick part categories and create quick parts under each and request the user to pick from it, but the combo box list is a master data which may change over a period of time. How to handle that?
    2. Upon inserting a quick part can I fill in with some dynamic values (for eg., Dear Mr.<Name>). I want the name to be pulled from SharePoint (or say from a local variable which I can pre-fill upon load).
    3. Currently I have created all the quick parts manually. Is there any programmatic way to build this?
    4. Can I create filter on conversation based on categories field programmatically which would get set when the add-in is deployed?

    Any suggestion or direction would greatly help me.

    Thanks

    Mahesh

    Sunday, August 5, 2012 4:22 PM

Answers

All replies

  • Hi Rajmahesh,

    Thanks for posting in the MSDN forum.

    It's based on my experience that your issue has more relationship with SharePoint. In this issue the important thing is know Sharepoint how to format the data which you will receive on our Outlook client. Do you aware of it?

    Have a good day,

    Tom


    Tom Xu [MSFT]
    MSDN Community Support | Feedback to us

    Monday, August 6, 2012 5:22 AM
    Moderator
  • Hi Tom,

    Thanks for responding.

    I can handle the SharePoint part and I am already retrieving the information. Only area I am finding difficulty is in Outlook customization.

    More that other items, I am interested knowing about the second point

    "Upon inserting a quick part can I fill in with some dynamic values (for eg., Dear Mr.<Name>). I want the name to be pulled from SharePoint (or say from a local variable which I can pre-fill upon load)."

    So to make it more clear if i have a text Dear Mr.<Name> in quick part how can I replace <Name> with a value from local variable upon inserting the quick part in to the mail body.

    Thanks

    Mahesh

    Monday, August 6, 2012 3:05 PM
  • Hi Mahesh,

    I hope following snippet can help you out:

    Sub InsertQuickPart(strPartName As String)
        Dim objOL As Outlook.Application
        Dim objDoc As Word.Document
        Dim objWord As Word.Application
        Dim objSel As Word.Selection
        Dim objETemp As Word.Template
        On Error Resume Next
         
        Set objOL = Outlook.Application
        Set objDoc = objOL.ActiveInspector.WordEditor
        Set objWord = objDoc.Application
        Set objSel = objDoc.Windows(1).Selection
        Set objETemp = objWord.Templates(1)
        objETemp.BuildingBlockEntries(strPartName).Insert _
          Where:=objSel.Range, RichText:=True
           
        Set objOL = Nothing
        Set objDoc = Nothing
        Set objWord = Nothing
        Set objSel = Nothing
        Set objETemp = Nothing
    End Sub
    

    Have a good day,

    Tom


    Tom Xu [MSFT]
    MSDN Community Support | Feedback to us

    Tuesday, August 7, 2012 8:08 AM
    Moderator
  • Hi Tom,

    Thanks for the snippet.

    I am quite new to Outlook programming, so guessing here. Snippet looks like it inserts the selected text from body section into quick part gallery upon this function invoke. In my scenario, I want to capture the event that triggers when a end user inserts a quick part from quick part gallery into the body section and then do some string manipulation.

    Please let me know if my statement is not clear. I will try to elaborate a little with real time example.

    Thanks,

    Mahesh

    Tuesday, August 7, 2012 4:25 PM
  • Hi Mahesh,

    There seems no event will relate to your wish if I don't misunderstand your goal.

    T.X.


    志异征诛,三让两家王朝
    功同开辟,一桮万古江南

    Wednesday, August 8, 2012 11:06 AM
  • Thanks for your input TX.

    I will see if I can find any alternate way or will finally go with manually editing the placeholders.

    Thanks,

    Mahesh

    Wednesday, August 8, 2012 3:45 PM
  • Hi Mahesh,

    I think the reply of T.X. is this issue's answer, I will mark it. If you feel this isn't the answer for your issue please feel free to unmark it.

    Have a good day,

    Tom


    Tom Xu [MSFT]
    MSDN Community Support | Feedback to us


    Monday, August 13, 2012 2:00 AM
    Moderator