Solved

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

Posted on 2001-08-13
12
629 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
 
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

This is an old article, please see an updated version of this article, located here: http://www.experts-exchange.com/articles/23619/Notes-8-5x-Windows-7-Notes-info-and-tips.html
Lack of Storage capacity is a common problem that exists in every field of life. Here we are taking the case of Lotus Notes Emails, as we all know that we are totally depend on e-communication i.e. Emails. This article is fully dedicated to resolvin…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

708 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now