Skip to main content
 
developerWorks
AIX and UNIX
Information Mgmt
Lotus
New to Lotus
Products
How to buy
Downloads
Live demos
Technical library
Training
Support
Forums & community
Events
Rational
Tivoli
WebSphere
Java™ technology
Linux
Open source
SOA and Web services
Web development
XML
My developerWorks
About dW
Submit content
Feedback



developerWorks  >  Lotus  >  Forums & community  >  Notes/Domino 6 and 7 Forum

Notes/Domino 6 and 7 Forum

developerWorks

  

Sign in to participate PreviousPrevious NextNext


aadi Ghamande 19.Feb.08 10:48 AM a Web browser
Domino Designer All Releases All Platforms


Hi,
I have the below code which will take attachment form one document and attach it to the currently opened document.
Below is the code.

Sub Click(Source As Button)
'*****************************'
'attach the base figure file's automatically..code transferred to a button..
'*****************************
Dim ws As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Dim doc As NotesDocument

Dim sess As New NotesSession
Dim db As NotesDatabase
Dim autoattachview As NotesView
Dim fdoclink_0 As NotesDocument

Dim item As NotesItem
Dim rti As NotesRichTextItem
Dim rti1 As NotesRichTextItem
Dim rti2 As NotesRichTextItem

Dim auto As String
Dim trackauto As String
Set uidoc=ws.CurrentDocument
Set doc=uidoc.Document

Set db=sess.CurrentDatabase

'auto=uidoc.FieldGetText("FigureFileUNID")
'trackauto=doc.trackautoattach_0(0)
' doc.trackautoattach_0=
'Msgbox auto
'Msgbox trackauto
If uidoc.EditMode=True Then
' If auto<>trackauto Then
If uidoc.FieldGetText("Status") <> "Released" Then
Set rti = doc.GetFirstItem( "AttachFile")
If uidoc.FieldGetText("AttachFile") <> "" Then
Call doc.RemoveItem( "AttachFile" )
Set rti = doc.CreateRichTextItem( "AttachFile")
End If

If uidoc.fieldgettext("FigureFileUNID") <> "" Then
i = 0
Set item=doc.GetFirstItem("FigureFileUNID")
Set autoattachview=db.GetView("FigureFile")
Forall values_0 In item.Values
unid = Cstr(values_0)
'Msgbox unid
Set fdoclink_0 =autoattachview.GetDocumentByKey(unid)
'Msgbox unid
Set rti1=fdoclink_0.GetFirstItem("AttachFile")
Set rti2=Doc.GetFirstItem("AttachFile")
If rti2 Is Nothing Then
Set rti2=Doc.CreateRichTextItem("AttachFile")
'Set rti2=rti1.CopyItemToDocument(doc,autoattach_1)
Call rti2.AppendRTItem(rti1)
Call rti2.AddNewLine(1)
Call doc.Save(True,True)
Else
Call rti2.AppendRTItem(rti1)
Call rti2.AddNewLine(1)
Call doc.Save(True,True)

End If
End Forall
End If
'End If
End If
End If
'doc.trackautoattach_0=doc.FigureFileUNID(0)
'Dim attach As String
'attach=doc.trackautoattach_0(0)
'Msgbox attach
End Sub


Now this code works on QueryClose and button also but the attachment is not visible. N if one see the doc properties then the documents property says that this doc do contain attachment. (in $FILE). And I have to keep this code on a button and not on queryclose.
What can be the problem? Please let me know.






Attachment not transferred.. (aadi Ghamande 19.Feb.08)
. . RE: Attachment not transferred.. (Stephen Zhao 19.Feb.08)
. . RE: Attachment not transferred.. (Andre Guirard 19.Feb.08)





  Document options
Print this pagePrint this page

 Search this forum

  Forum views and search
Date (threaded)
Date (flat)
With excerpt
Author
Category
Platform
Release
Advanced search

 Sign In or Register
Sign in
Forgot your password?
Forgot your user name?
Create new registration

 RSS feedsRSS
All forum posts RSS
All main topics RSS
More Lotus RSS feeds

Resources

 Resources
Forum use and etiquette
Native Notes Access
Web site Feedback

Lotus Support

 Lotus Support
IBM Support Portal - Lotus software
Lotus Support documents
Lotus support by product
Lotus support downloads
Lotus support RSS feeds

Wikis

 Wikis
IBM Composite Applications
IBM Mashup Center
IBM Connections
IBM Docs
IBM Forms
IBM Mobile Connect
IBM Sametime
IBM SmartCloud for Social Business
IBM Web Experience Factory
Lotus Domino
Lotus Domino Designer
Lotus Expeditor
Lotus Foundations
Lotus iNotes
Lotus Instructor Community Courseware
Lotus Notes
Lotus Notes & Domino Application Development
Lotus Notes Traveler
Lotus Protector
Lotus Quickr
Lotus Symphony
IBM Web Content Manager
WebSphere Portal

Lotus Forums


 Lotus Forums
Notes/Domino 9.0
Notes/Domino 8.5 + Traveler
Notes/Domino XPages development forum
Notes/Domino 8
Notes/Domino 6 and 7
Notes/Domino 4 and 5
IBM Connections
IBM Forms
IBM Mobile Connect
IBM Sametime
IBM SmartCloud Notes
IBM SmartCloud Meetings
IBM Web Content Manager
Lotus Domino Document Manager
Lotus e-learning
Lotus Enterprise Integration
Lotus Expeditor
Lotus Protector
Lotus Quickr
Lotus SmartSuite
Lotus Symphony
Lotus Symphony Developer Toolkit Support
Lotus Workflow