Home > Domino Tips > Developer > LotusScript > Copy attachments in LotusScript without detaching
Domino Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

LOTUSSCRIPT

Copy attachments in LotusScript without detaching


Brad Balassaitis
12.27.2004
Rating: -4.00- (out of 5)


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


View member feedback to this tip.

This procedure copies file attachments from the current Web document to an existing document (but it can be modified to work for the Notes client as well just by changing the docSource object).

There is no direct way to copy file attachments -- copying the $FILE item with CopyItemToDocument and using doc.ReplaceItemValue do not work on $FILE items. Using doc.CopyAllItems works, but that is not desirable, as I only want to copy the attachments.

The normal workaround is to detach attachments from the source document to the hard drive and re-attach them to a rich text field on the target document. However, that's often restricted on a server, so I'd like to avoid it.

Here is a better strategy:

MEMBER FEEDBACK TO THIS TIP

This is a very easy way to do a very useful thing.

—Alejandro M.

******************************************

This is a great tip. However, I was trying to e-mail attachments to another person using a new document I created in LotusScript, but the attachments did not send.

—Annonymous

******************************************

I'm pretty sure you would need to save the document for the attachments to be stored on


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


RELATED CONTENT
LotusScript
LotusScript sorts lists alphabetically
LotusScript code rebuilds corrupted busytime.nsf file
Soft-code item names to facilitate LotusScript management
LotusScript agent automates selective mail file replication
LotusScript filters and attaches files to a Notes form
How to create mail files using a LotusScript agent
Extract value pairs from text arrays with LotusScript
Mass-input form uses LotusScript to ease large-scale employee moves
LotusScript button updates email addresses in Lotus Notes PAB
Code exports Lotus Notes data to an OpenOffice Calc spreadsheet

LotusScript
LotusScript sorts lists alphabetically
Run or restart Notes/Domino agents via text messages
LotusScript code rebuilds corrupted busytime.nsf file
Soft-code item names to facilitate LotusScript management
LotusScript agent automates selective mail file replication
Can I create and copy Microsoft Excel spreadsheets with LotusScript?
LotusScript filters and attaches files to a Notes form
How to create mail files using a LotusScript agent
Can you use LotusScript to read a text file attached to a Notes doc?
Extract value pairs from text arrays with LotusScript

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary


it. This isn't necessary with most types of fields, but it is usually the case with rich text data. (You just don't normally save documents that are created in the background only to be e-mailed out.)

—Brad Balassaitis, tip author

******************************************

Thanks for the tip. I'm using R5, and have no chance of testing whether this is required for other versions, but in my case I also had to copy the rich text field in which the file was originally attached to have it work properly. Without it the docTemp that contained only the $FILE field lost its Items-property entirely.

—Jukka D.

******************************************

When I created this code, I tested it in a web application, where attachments are not tied to specific rich text fields. This user probably used it in a Notes client application where the attachment was stored in a specific field, so this makes sense.

—Brad Balassaitis, tip author

Do you have comments on this tip? Let us know.

Please let others know how useful it is via the rating scale below. Do you have a useful Notes/Domino tip or code to share? Submit it to our monthly tip contest and you could win a prize and a spot in our Hall of Fame.

Rate this Tip
To rate tips, you must be a member of SearchDomino.com.
Register now to start rating these tips. Log in if you are already a member.


Submit a Tip




DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



Domino & Lotus Notes Security Solutions: Authentication, Antispam, Encryption and Antivirus
HomeTopicsITKnowledge ExchangeTipsAsk the ExpertsMultimediaWhite PapersDomino IT Downloads
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 1999 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts