Solved

Creating hyperlinks to local documents in a memo body w/LotusScript?

Posted on 2001-08-13
12
634 Views
Last Modified: 2013-12-18
We're trying to write some code that walks through a user's e-mailbox, detaching any file attachments, removing them from the mail, and replacing them with "hyperlinks" to the physical location of the file.  This will save server space while still allowing users to access their attachments as if they were still attached to the mail.

I've got the code written to do the removal of the attachments, but can't seem to get the hyperlink stuff working.  Anyone have suggestions on how to create a hyperlink through LotusScript?

This is on 5.08 on a Win2k platform.

Dave
0
Comment
Question by:Moonshadow
  • 5
  • 4
  • 3
12 Comments
 
LVL 13

Expert Comment

by:CRAK
ID: 6383408
Have you considered "shared mail"?
0
 
LVL 9

Expert Comment

by:Arunkumar
ID: 6384123
Shared mail wont solve the purpose since if any one of 10 recipients does not delete the mail then the server space is eaten like hell.

I guess i have a simpler solution.  I just am hunting for it.  Hang around.

:-)
Arun
0
 

Author Comment

by:Moonshadow
ID: 6384147
Don't lose too much sleep on this.  It's more of a pet-project sort of thing than anything needing immediate help.

Though I do appreciate the assistance!

Dave
0
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
LVL 9

Expert Comment

by:Arunkumar
ID: 6384157
I got it, send me your email id let me forward that to you !

:-)
Arun
0
 

Author Comment

by:Moonshadow
ID: 6384172
You can send to david_lundy@shepherd.org.

Thanks 'mate!
0
 
LVL 9

Expert Comment

by:Arunkumar
ID: 6384185
Anytime buddy !

Removing some contents from the db as it may not be applicable to you.

:-)
Arun
0
 
LVL 9

Accepted Solution

by:
Arunkumar earned 200 total points
ID: 6384298
Its on the way.....
0
 

Author Comment

by:Moonshadow
ID: 6386022
Well, after serious work, it appears that this is an issue that just can't be solved.  The Notes client appears to not be able to display HTML code in its documents, although the web-client can.

Thanks to Arunkumar for all the help working with this.  You really put a lot of time into something that you didn't have to.  I very much appreciate it.

Dave
0
 
LVL 13

Expert Comment

by:CRAK
ID: 6387176
Arun,

You were right about shared mail, but depending on the solution I can't see the difference to detaching/linking if an attachment was sent to several people.

So I'm curious:

How did you solve deletion of attachments after deletion of the message? Are you keeping track of who deposited which attachment?
Are you storing attachments local (C:) or on a mapped drive? I never realy thought of a local drive....!
And what about duplicate filenames?

I don't need the code: I only find it interesting to know how certain problems are tackled.
0
 
LVL 9

Expert Comment

by:Arunkumar
ID: 6387735
Well,

Dave and i were discussion across emails and trying various solutions, he understood the complexity at one stage and he said let the work be done manually by all the users and the hyperlink was avoided all they have decided it to detach the file from the email and put a path in that place where they could find the actual file in their hdd, pretty much workload for the users but Dave concluded that they have to live with it.

:-(
Interestingly he has offered me points for discussing with him across mail.
:-)
0
 
LVL 13

Expert Comment

by:CRAK
ID: 6388270
I already had a feeling that this could be even harder than it seemed!
Should I send him a mail to, you think?

Just joking Dave! ;-))

One remark for you though:
I don't know about the knowledge level of your users, but some of mine would certainly link to files in their own C-drive, wondering why other's can't open the link....
Make sure everyone understands: decisions like that might backfire on the helpdesk!

Good luck!
0
 

Author Comment

by:Moonshadow
ID: 6388363
Well, here's the rub:

We've got some users here that have 600-700Mb mail files chocked full of attachments.  They claim that they cannot remove the attachments from their mails because a) there's too many, b) they need to store them all for reference, and c) they need to know who sent which attachment when. However, they're soaking up a boatload of our server space.

As an alternative, we're proposing to remove each attachment from the user's e-mail, save it on their shared Netware drive (which has a huge amount of HD space), and replace the attachment with a link to that document.  This allows the users to maintain their mail file exactly as it is now, but without the sizable attachments. T'would be much better.

I'd already written the code that walks through their mailfile and detaches/removes the files.  The problem I'd had was creating the doclink/hyperlink back to the document.  However, the Notes client doesn't seem to be able to handle hyperlinks well.  The only solution I can find is to replace the attachment with a text line stating where the file was detached to.  It's servicable, if not terribly elegant.

I've attached my code here so you can see what I'm talking about.  I suggest you don't run it on a live mail database until you see how it works.  :)

===========================================================

Sub Initialize
  Dim uiws As New NotesUIWorkspace    
  Dim session As New NotesSession
  Dim db As NotesDatabase
  Dim view As NotesView
  Dim doc As NotesDocument
  Dim rtitem As Variant
  Dim fileCount As Integer
  Dim filename As String
  Dim ext As String
  fileCount = 0    
     
  Set db = session.CurrentDatabase
  Set view = db.GetView ( "($All)" )
  Set doc = view.GetFirstDocument
     
  While Not ( doc Is Nothing )
    If ( ( doc.form (0) = "Memo" ) Or ( doc.form (0) = "Reply" ) ) Then
      Set rtitem = doc.GetFirstItem ( "Body" )
      If ( Not ( rtitem Is Nothing ) ) Then
        If ( rtitem.Type = RICHTEXT ) And ( doc.HasEmbedded ) Then
          Forall o In rtitem.EmbeddedObjects
            filename = Left ( o.Source, Len ( o.Source ) - 4 )
            ext = Right ( o.Source, 4 )
            If ( o.Type = EMBED_ATTACHMENT ) Then
              If ( Dir ( "C:\attachments\" & filename & ext ) = "" ) Then
                Call o.ExtractFile ( "C:\attachments\" & filename & ext )
          filename = "C:\attachments\" & filename & ext
              Else
                If ( Dir ( "C:\attachments\" & filename & " - " & fileCount & ext ) = "" ) Then
                  Call o.ExtractFile ( "C:\attachments\" & filename & " - " & fileCount & ext )
            filename = "C:\attachments\" & filename & " - " & fileCount & ext
                Else
                  fileCount = fileCount + 1
                  Call o.ExtractFile ( "C:\attachments\" & filename & " - " & fileCount & ext )
            filename = "C:\attachments\" & filename & " - " & fileCount & ext
                End If
              End If
              Call o.Remove
           Call rtitem.AppendText ( "File detached to: " & filename )
              Call doc.Save ( True, True )
            End If
          End Forall
        End If
      End If
    End If
    fileCount = 0
    Set doc = view.GetNextDocument (doc)
  Wend
End Sub
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
Article by: Rob
Notes 8.5 Archiving Steps and Tips This article covers setting up a Notes archive, and helps understand some of the menu choices making setting up and maintaining a Notes archive file easier.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question