Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to attach while document is made by Composedocument by VBA?

Status
Not open for further replies.

Flippertje

Technical User
Mar 12, 2004
118
NL
Hello all,

first of... my english isn't all that well.. so please be patient with me :)

i'm having a problem doing the following:
i have a notesdatabase in which i'm trying to compose a form called "Melding" by VBA. In this form i have a field called "Verzoek". In this field i'm trying to place an attachment by VBA. I'm getting nowhere...

Any help is greatly appreciated!!!

Flippertje.

My code so far:

Sub makemehappy()

dim workspace as object
dim bestandje as string

bestandje="H:\meldingkje.doc"

set workspace=createobject("Notes.NotesUIWorkspace")
call workspace.opendatabase("domino-1",plw\office.nsf)

set uidoc=workspace.composedocument("","","Melding")

'here should be a code which attaches the document 'bestandje'....

call uidoc.save(false, false)

end sub
 
For all the interested people; it took me time but here it is:)

=================================
dim workspace
dim uidoc
dim bestand9 as string

bestandje="H:\meldingkje.doc"

set workspace=createobject("Notes.NotesUIWorkspace")
set uidoc=workspace.composedocument("servername","databasename","nameofNewNotesDocument")

call uidoc.gotofield ("Fieldname where Attachment will be put")
uidoc.editmode=true
call uidoc.createobject("TestOpject", , bestandje)

set workspace=nothing
set uidoc=nothing
=============================

I hope this code helps you out and spares you the time it costed me:)

Have fun!

grtz Flippertje
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top