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!

GetNEXTitem?

Status
Not open for further replies.

daveonion

Programmer
Aug 21, 2002
359
GB
Hi I have wrote a script to loop through a view and detach all documents.

however i'm not sure of the syntax for getting the next item, so far the code only returns the first item.

any help would be appreciated

thanks in advance
 
Sorry, could you clarify a bit ?
Does your problem concern cycling the items in the document, cycling attachments in the document, or cycling the documents in the view ?

Pascal.
 
hi, i am trying to cylce through attachments within the same item, however it seems to be giving the right amount however it is the same attachment per record, as opposed to 3 seperate attachments per record, the code i have is as follows

Dim count2 As Integer

Set db=ns.CurrentDatabase
Set pView=db.GetView("forexport2")

pView.AutoUpdate=False
SavePath="c:\Photos\"
Set pDoc=pView.GetFirstDocument
While Not pDoc Is Nothing
count2 = 1
Set rtItem=pDoc.GetFirstItem("Imagev")
'If (rtItem.Type=RICHTEXT) Then If Not Typename(rtItem.EmbeddedObjects)="EMPTY" Then
Forall o In rtitem.embeddedobjects
count2 = count2 + 1
If (o.Type=EMBED_ATTACHMENT) Then
Call rtItem.EmbeddedObjects(0).ExtractFile(SavePath & pDoc.PanelKey(0) & "_" & count2 & ".jpg")
End If
End Forall
End If
Set pDoc=pView.GetNextDocument(pDoc)
Wend
End Sub
 
Where are the Dims? If you declare these in the Declarations event, fair enough, but you need to declare variables before you use them...

Also, your Ifs and your End Ifs don't add up...

Sorry if this is no help at all, but I'm not at the stage of reading code fluently yet, and I don't have time to explore yours at the moment! But are you already aware of these two points?

I've had problems with Domino Designer 6 removing my End If statements, apparently at random, which is very annoying! When you save a form, make sure youselect a field or event with no code in it, then save, and then it doesn't remove your code!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top