Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Attaching a file with LotusScript

1,999 views
Skip to first unread message

Yves-Eric

unread,
Jan 14, 1997, 3:00:00 AM1/14/97
to

shav...@sn.no, atd...@sefes.es

>>Josep Aulina wrote:
>> Does anyone Know how I can attach a file to a richtext using lotusscript ?
>> I try to use the embedObject method defined in NotesRichTextItem, but it
>> return the error: 'Object variable not set'
>> Thank you for advance.
>
>Her's some lines of my code :
>
> Dim body As Notesrichtextitem
> Dim objekt As NotesEmbeddedObject
>........
> Set memo = New NotesDocument(db)
> Set body = New Notesrichtextitem (memo,"Body")
> memo.Form = "Memo"
>.......
> Set objekt = body.EmbedObject( EMBED_ATTACHMENT,
>"",itempath+filename,"Here comes a file")
>Voila, the file is attached !!
>-staale-

This example works only when you want to create a NEW document with a file
attachment.

But how could you do this via a button on the current (open) uidocument ?
i can't find how to access my RTF field

thanks

Yves-eric Martin

Marc JACOB

unread,
Jan 23, 1997, 3:00:00 AM1/23/97
to

y...@mail.dotcom.fr (Yves-Eric) wrote:

>shav...@sn.no, atd...@sefes.es

>thanks

>Yves-eric Martin

This code works with the current document and uidoc.

Attachment :

Dim workspace As New notesuiworkspace
Dim uidoc As notesuidocument
Dim db As NotesDatabase
Dim Doc As NotesDocument
Dim rtitem As notesrichtextitem
Dim soc As Variant
Dim object As notesembeddedobject

Set uidoc=workspace.currentdocument
Set doc = uidoc.document
Set db=doc.parentdatabase

'Set rtitem=doc.getfirstitem("detail_dbfile")
Set rtitem=New notesrichtextitem(doc,"body")
Set object=rtitem.embedobject(EMBED_ATTACHMENT,"",
"c:\malo\devis\devis.db","test")

Detachment :

Dim workspace As New notesuiworkspace
Dim uidoc As notesuidocument
Dim db As NotesDatabase
Dim Doc As NotesDocument
Dim rtitem As Variant
Dim soc As Variant
Dim object As notesembeddedobject

Set uidoc=workspace.currentdocument
Set doc = uidoc.document
Set db=doc.parentdatabase

Set object = doc.GetAttachment( "devis.db" )
'Messagebox(object.name)
Call object.extractfile("c:\malo\devis\temp\test2" )
Call object.remove

Marc JACOB.


Jim Guinn

unread,
Jan 28, 1997, 3:00:00 AM1/28/97
to


Marc JACOB <ja...@iprocess.com> wrote in article
<5c7acl$7...@prof.ese-metz.fr>...


> y...@mail.dotcom.fr (Yves-Eric) wrote:
>
> >shav...@sn.no, atd...@sefes.es
>
> >>>Josep Aulina wrote:
> >>> Does anyone Know how I can attach a file to a richtext using
lotusscript ?

Forgive me for entering a thread that I haven't read from the start, but
does it have to be Lotus Script? I created a button and used the following
formula language:

@Command( [EditUp] );
@Command([EditInsertFileAttachment];Path)

Where @Command([EditUp]); accesses the Rich Text Field directly above my
button in my form and Path is another field containing the full path and
filename of the file to attach.

> >>> I try to use the embedObject method defined in NotesRichTextItem, but
it
> >>> return the error: 'Object variable not set'
> >>> Thank you for advance.

> >>> [rest deleted]
>
> Marc JACOB.
>

Jim Guinn
jlg...@uncc.edu

Ron Bolzern

unread,
Jan 30, 1997, 3:00:00 AM1/30/97
to

And, can you get the contents out of a MS-Word file in order to import
it to a Notes file?

TIA
Ron Bolzern, Microsoft CP, Lotus CLP
Scone, Scotland

0 new messages