Ask a questionAsk a question
 

Answerauto create a link to a word doc

  • Friday, October 02, 2009 3:09 PMRhubarb65 Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hi
    I would like to customise a Bug WI so that on creation it shows a http link to a Word doc on a file server. The user can click on the link to open up the doc in Word. If it is the first time then the doc is auto created on the fileserver. The user can edit the doc and save it. Other users can click on the WI link and do the same

    So the link field should be:-
    Read Only
    auto generated
    a clickable link something like

    http://www.company.com/fileserver/TFSBugDoc?id=bugID   (where BugID is the ID of the WI)

    Is this possible out of the box or will I need C# magic.

    Peter

Answers

  • Wednesday, October 07, 2009 5:37 AMRuiz YiModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    Hi Peter,

    Workitem Type Definition does not support what you want, the best way that meet your requirement is to create a custom workitem control.

    Other way you can add a link \\fileserver\bug***.doc in link tab, but you need to add it manually.

    Best Regards,
    Ruiz


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. Sincerely, Ruiz Yi

All Replies

  • Tuesday, October 06, 2009 6:56 AMRuiz YiModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hi Peter,


    To create a link automatically, You need to use custom work item control.

    You can intergate your control with workitem LinkControl, please read this article for detail  How to extend linking and workitem UI with custom link types

    Another way you can create a independent control. you can refer to this article http://www.cnblogs.com/Ruiz/archive/2009/10/01/1577217.html

    I think the second way is more simple. You can just create a control with a button and a link, you can use m_workItem.Links to display or set the specified link.

    To create,edit and save the file, it depends on your file server. Work Item UI can only display a link to the file url.

    Best Regards,
    Ruiz
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. Sincerely, Ruiz Yi
  • Tuesday, October 06, 2009 3:45 PMRhubarb65 Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Thanks for the info. We will not be doing any custom work for the time being

    I am also looking at links of the form

    \\server\dir\bugXXX.doc

    I cannot make this clickable (as it is not HTML) but I was atleast hoping to make it default in a field. The user could then manually change the XXX to the bug ID and then cut/paste it to get to a Word doc

    However it appears that backslashes are not allowed in a string field. I get the following error when I try to import the WIT

    TF26204: The account you entered is not recognized...

    Is there a workaround to the backslash problem?

    alternatively, what is the best technique to achieve my goal (which is to help the user get to a bugWI specific word doc)

    Peter
  • Wednesday, October 07, 2009 5:37 AMRuiz YiModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    Hi Peter,

    Workitem Type Definition does not support what you want, the best way that meet your requirement is to create a custom workitem control.

    Other way you can add a link \\fileserver\bug***.doc in link tab, but you need to add it manually.

    Best Regards,
    Ruiz


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. Sincerely, Ruiz Yi
  • Wednesday, October 14, 2009 7:19 PMRhubarb65 Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hi

    actually I *have* developed a Custom Control. I used the example on CodePlex (that does a screen capture) to get started

    I now have a button that when pressed opens (and creates if necessary) a Word doc on a fileserver based on a template.dot.

    seems to work. Nice to have an installer built in.

    problems still to solve are:
    1) code still seems to be "binded" to codeplex (might have to download it again)
    2) not sure if I should lock the word doc (is it possible?)
    3) I might add some dynamic fields to the template and push in the values from the work item eg ID, Title, created timestamp

    Peter