View Single Post
 
Old 03-07-2011, 06:33 PM
cksm4 cksm4 is offline Windows XP Office 2007
Advanced Beginner
 
Join Date: Aug 2010
Posts: 48
cksm4 is on a distinguished road
Default Inserting a Hyperlink and Rich Text in Groupwise Email

Hello all,

Yes we still use GroupWise. I have found and modified a macro that creates and sends an email as needed. It works great, except that I need to insert a hyperlink to a file on the network. In order to hyperlink, the inserted text must be rich text. My problem is that the code creates an e-mail where the text is distorted and some of the characters disappear. Here is the code:

Code:
 
Private Sub CmdSubmit_Click()
 
Dim gwMessage As GroupwareTypeLibrary.Message2
Dim gwaccount As GroupwareTypeLibrary.Account2
Dim gwapp As GroupwareTypeLibrary.Application
Dim gwattach As GroupwareTypeLibrary.Attachment
Dim Manager As String
    
Manager = InputBox(Prompt:="Enter manager user ID:", _
        Title:="SUBMIT DOCUMENT FOR REVIEW")
If Manager = "" Then
    Manager = InputBox(Prompt:="You have not entered a user ID! Enter manager user ID:", _
          Title:="SUBMIT DOCUMENT FOR REVIEW")
End If
'Open a groupware session.
Set gwapp = CreateObject("NovellGroupWareSession")

'Login using the open acount
Set gwaccount = gwapp.Login()
'Create a new message in the mailbox.
Set gwMessage = gwaccount.MailBox.Messages.Add("GW.MESSAGE.MAIL", egwDraft)
gwMessage.BodyText.RTF = "File://" & ActiveDocument.Path & "\" & ActiveDocument.Name
gwMessage.Subject = "Pending Review"
gwMessage.Recipients.Add Manager
'Send the message
gwMessage.Send
I believe I need the "File://" included in the 'gwMessage.BodyText.RTF' command to create the hyperlink, although my value may be wrongly formatted for a string. Although, I did a msgbox with the value and it appears right. (Note the RTF is needed in the 'gwMessage.BodyText.RTF' command for rich text).

It appears the "-" character in my file path could be causing an issue as this is where the distortion starts. What am I doing wrong??

Thanks!
Brock
Reply With Quote