how do i put a custom label on a link when creating an outlook task?


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: how do i put a custom label on a link when creating an outlook task?

  1. #1
    Join Date
    Jul 2009
    Posts
    0

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

    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:



    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.

    by the way, i'm using visual studio 2005, microsoft outlook 2003 and outlook interop from outlook 2003.

    Code:
    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

  2. #2
    Join Date
    May 2004
    Location
    Duluth MN
    Posts
    353
    Here are a couple of links that should point you in the right direction. It appears you need to use word objects to do what you want:

    Insert hyperlink in Outlook 2007 items

    Use VBA to insert hyperlink in Task Body

    ...joe

Similar Threads

  1. creating Custom control for windows app
    By srinivasc_it in forum .NET
    Replies: 1
    Last Post: 09-29-2006, 04:01 AM
  2. Creating a link list file and loading a lib
    By ram_son in forum VB Classic
    Replies: 8
    Last Post: 03-29-2005, 04:09 PM
  3. Creating link to outlook exchange calender
    By Tom in forum Enterprise
    Replies: 0
    Last Post: 09-30-2002, 10:25 AM
  4. Creating link
    By Tom in forum Web
    Replies: 0
    Last Post: 09-30-2002, 07:47 AM
  5. Replies: 1
    Last Post: 08-16-2002, 11:31 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center