?
Solved

insert file text attachment in a body field

Posted on 2003-03-19
9
Medium Priority
?
226 Views
Last Modified: 2013-12-18
I receive mails with file TXT attachments
I want to modify the body field of this mail by adding the content of this TXT file attachment

any idea ?
0
Comment
Question by:AlainLimoges
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
9 Comments
 
LVL 7

Expert Comment

by:scottrma
ID: 8168172
You could write a new mail agent to look for .txt file attachments in your incoming mail, and if they are found, detach them, then read their contents into memory and write (append) the contents to the Body field of the email.
0
 

Author Comment

by:AlainLimoges
ID: 8168319
have you a script exemple, I'm not specialist of LotuScript
0
 

Author Comment

by:AlainLimoges
ID: 8168575
have you a script exemple, I'm not specialist of LotuScript
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:AlainLimoges
ID: 8168684
have you a script exemple, I'm not specialist of LotuScript
0
 
LVL 7

Expert Comment

by:scottrma
ID: 8178697
Set s = New NotesSession
Set db = s.CurrentDatabase
Set col = db.UnprocessedDocuments
Set doc = col.GetFirstDocument

While Not (doc Is Nothing)

     Forall o in doc.EmbeddedObjects

          If o.Type = EMBED_ATTACHMENT And Lcase$(Right$(o.Name,4)) = ".txt" Then

               s.ConvertMime = True
               Set body = doc.GetFirstItem("Body")

               FilePath$ = "C:\temp\" & o.Name
               Call o.ExtractFile(FilePath$)
               FileNum% = FreeFile()
               Open FilePath$ For Input As FileNum%

               Do While Not EOF(FileNum%)

                    Line Input #FileNum%,temp$
                    Call body.AppendText(temp$)
                    Call body.AddNewLine(1)

               Loop

               Call doc.Save(True,False)
               Close #FileNum%
               Kill FilePath$

          End If

     End Forall

     Set doc = col.GetNextDocument(doc)

Wend
0
 
LVL 7

Accepted Solution

by:
scottrma earned 200 total points
ID: 8178712
Put the above into a new mail agent in your mail database. Whoever saves the agent (that's you) must be listed in the "Allowed to run unrestricted LotusScript agents" field in the Server document for the server where your mail file is hosted. In the example above I have set C:\temp\ as the temporary folder where the detached files will be stored and read from. After reading their contents and appending them to the body of the mail, the detached files are deleted. The folder C:\temp\ must exist ON THE SERVER, not the client, otherwise the script will generate an error.

Regards,

Scott
0
 

Author Comment

by:AlainLimoges
ID: 8179199
ok thanks a lot
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Problem "Can you help me recover my changes?  I double-clicked the attachment, made changes, and then hit Save before closing it.  But when I try to re-open it, my changes are missing!"    Solution This solution opens the Outlook Secure Temp Fold…
For beginners of Lotus Notes user this is important to know about the types of files and their location supported by IBM Notes. Mostly users are unaware about how many file types are created and what their usages are. This Article is fully dedicated…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Suggested Courses

777 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