Hi Sean,
Ok, the ctProjects is the name that i gave to that instance of the Create Task object that I dropped onto the workflow.
ctproject.ListItemId gives you the task ID that the task has been assigned by SharePoint. To see this for yourself, connect to a sharepoint list and open a workflow task form from the task list.
The URL will look similar to: http://webserver/_layouts/WrkTaskIP.aspx?List=b0320c4f%2Df791%2D4a9c%2D9b6f%2D3f1eef448fe5&ID=1
What my code does is grab the relevant parts of this url from the various objects in the workflow and then re-builds it for inclusion in the task e-mail.
string weburl = workflowProperties.WebUrl; webserver
string taskUrl = "/_layouts/WrkTaskIP.aspx?List="; /_layouts/WrkTaskIP.aspx?List=
string listId = workflowProperties.TaskListId.ToString(); b0320c4f%2Df791%2D4a9c%2D9b6f%2D3f1eef448fe5
The final line then rebuilds the url which is then wrapped in a standard hyperlink with http:// tacked on the front.
string fulltaskUrl = weburl + taskUrl + listId + "&ID=" + taskId
string htmlTaskLink = "<a href=" + "\"" + fulltaskUrl + "\"" + ">Click here to open the task directly in SharePoint</A>"
The other main object you're looking at here is workflowProperties. This is initialised as part of the onWorkflowActivated icon at the top of your workflow designer view and references things like the Guid of the Tasklist and the URL of the webserver hosting the workflow.
If you're going to be doing much with workflows, then I'd recommend that you try a book by David Mann, Workflow in the 2007 Microsoft Office System - Apress books. It's not the answer to all your prayers, but it's certainly a damn good start!
Regards
Paul.
www.myfatblog.co.ukMCTS: WSS 3.0
MCTS: MOSS 2007