Question how do i put a link when creating an outlook task?

tikboydev

New member
Joined
Jul 29, 2009
Messages
1
Programming Experience
1-3
hi... i'm relatively new to outlook task creation from visual basic. hope someone can help me... when i create an outlook task, i want to insert a link with a custom string... e.g. please see screenshot:

outlooktask_test.jpg


instead of the left screen, i would like to come up with the right screen. any help, tips or sample code would be highly appreciated... thank you very much in advance.


VB.NET:
Imports xOutlook = Microsoft.Office.Interop.Outlook

Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim xOutlookApp As New xOutlook.Application
        Dim xNameSpace As xOutlook.NameSpace = xOutlookApp.GetNamespace("MAPI")
        CreateTaskItem(xOutlookApp)
    End Sub

    Private Sub CreateTaskItem(ByRef xOutlookApp As xOutlook.Application)
        Dim xNewTask As xOutlook.TaskItem = CType(xOutlookApp.CreateItem(xOutlook.OlItemType.olTaskItem), Microsoft.Office.Interop.Outlook.TaskItem)

        xNewTask.Subject = "My Task " & Now.ToString
        xNewTask.PercentComplete = 50
        xNewTask.StartDate = Date.Now
        xNewTask.DueDate = Date.Now.AddDays(5)
        xNewTask.Status = Microsoft.Office.Interop.Outlook.OlTaskStatus.olTaskInProgress
        xNewTask.Complete = False

        '''' setting the task body
        xNewTask.Body = "Click <a href='http://www.google.com'>here</a> to view google." _
            & Environment.NewLine & Environment.NewLine _
            & "Test... http://www.google.com"

        xNewTask.Save()
    End Sub

End Class
 
Hi,

If I hv understood ur query, probably below is the solution.

1. Put a link label control on the form with text='here'.

2. Private Sub LinkLabel1_LinkClicked(ByVal sender As Object, ByVal e As EventArges)
System.Diagnostics.Process.Start("http:// www.google.com")
End Sub

Hope this helps u.

Thanks
Panna
 
Last edited by a moderator:
Back
Top