Home
TeamSite
Send an NRL Link
Rho
I have a Word macro that will allow a user to display the WorkSite search dialog box, select a file and then display an email message with the associated NRL link as an attachment.
Is there a way using the SendDocLinkCmd to set custom fields for the resulting email message and then send the email message?
While I am new to Interwoven development, I am very familiar with VBA development. I have not been able to find a way to set the To and Body properties of the email message and then automatically send it.
Any help would be greatly appreciated.
Find more posts tagged with
Comments
Rho
Here is the code I finally got to work to send an NRL link
Dim objDoc As IManage.NRTDocument
Dim doc As IManage.IManDocument
Dim strTypeAlias As String
Dim lReturnValue As Long
Dim lActionSelected As Long
Dim oOutlookApp As Object
Dim oItem As Object
Dim sFileName As String, strDatabase As String
Dim FileNum As Integer
strTypeAlias = ""
'get document from requestor
lReturnValue = iManVBALib.SelectDocument(objDoc, lActionSelected, strTypeAlias)
If (lReturnValue > 0) And (lReturnValue <= 3) Then
'build NRL Link
Set doc = objDoc
sFileName = "C:\" & CStr(objDoc.Number) & ".nrl"
FileNum = FreeFile()
Open sFileName For Output As #FileNum
Print #FileNum, "ServerName" & vbCr & doc.ObjectID
Close #FileNum
' Get Outlook if it's running
Set oOutlookApp = GetObject(, "Outlook.Application")
If Err <> 0 Then
Set oOutlookApp = CreateObject("Outlook.Application")
End If
'' On Error Resume Next
'Create a new mailitem
Set oItem = oOutlookApp.CreateItem(3)
With oItem
'Set the recipient for the new email
.Recipients.Add ("Recipient Name")
.Subject = "Desired Subject"
' .ReadReceiptRequested = False
' .Recipients.ResolveAll
.Body = "Any message text"
.Attachments.Add sFileName
.Display
End With
End If
actualTable.bmp
ResultTable.bmp
protocolsample.pdf