+ Reply to Thread
Results 1 to 2 of 2

Send email containing link in XML-format

Hybrid View

Claus Send email containing link in... 08-05-2009, 07:31 AM
Claus Re: Send email containing... 08-05-2009, 08:18 AM
  1. #1
    Registered User
    Join Date
    08-05-2009
    Location
    Holstebro, Denmark
    MS-Off Ver
    Excel 2007
    Posts
    2

    Send email containing link in XML-format

    I'm working on a program in Excel to aid our employees sending letters to a range of subcontractors.
    The program works fine, but now I need to implement it into our DMS (Doucment Management System).
    To ensure the right workflow I need to send an email to our secretary handling the printing, packing and sending of ordinary post.

    This mail should contain a link into DMS in XML-format.
    Syntax of the XML-link somthing like:
    <?xml version="1.0" encoding="utf-8"?>
    <docunote>
      <item number="D09-14352" type="Document" action="locate" />
    </docunote>
    My current code for sending the email:
    Emne = "Tegningsfordeling: " & Worksheets("SYS").Range("F2") & " " & Worksheets("SYS").Range("F3")
    If Me.TextBoxBem.Value <> "" Then Emne = Emne & ". BEMÆRK: " & Me.TextBoxBem.Value
    ActiveWorkbook.SendMail Worksheets("SYS").Range("F1"), Emne, True
    Can anybody help me on this problem.

    Regards

    Claus

  2. #2
    Registered User
    Join Date
    08-05-2009
    Location
    Holstebro, Denmark
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Send email containing link in XML-format

    I've changed the code in order to apply text to the body of the mail.
    The red line is where I need to have the link.

    Public Function SendEmail()
    On Error GoTo ende
    Emne = "Tegningsfordeling: " & Worksheets("SYS").Range("F2") & " " & Worksheets("SYS").Range("F3")
    If Me.TextBoxBem.Value <> "" Then Emne = Emne & ". BEMÆRK: " & Me.TextBoxBem.Value
    
    sendto = Worksheets("SYS").Range("F1")
    ebody = "<?xml version="1.0" encoding="utf-8"?><docunote><item number="D09-14352" type="Document" action="locate" /></docunote>"
    Set app = CreateObject("Outlook.Application")
    Set itm = app.createitem(0)
    
    With itm
    .Subject = Emne
    .To = sendto
    .body = ebody
    .Display
    .Send
    End With
        
    Set app = Nothing
    Set itm = Nothing
    
    ende:
    End Function
    Regards

    Claus

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1