Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8985919
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T21:25:51+00:00 2026-06-15T21:25:51+00:00

Early, I posted theme Groovy: autosave attachment with specific extension from Lotus Notes, but

  • 0

Early, I posted theme “Groovy: autosave attachment with specific extension from Lotus Notes”, but couldn’t find any solution, so i found different vbscripts and make own. Its works, but now i have a problem: letter doesn’t delete after as script autosave attach. I see error: “All objects must be from the same session”. I will be grateful for any idea.

Dim Session 
Dim Maildb 
Dim vw 
Dim doc 
Dim Item 
Dim x 
Set Session = CreateObject("Lotus.NotesSession") 
Call Session.Initialize("password") 
Set Maildb = Session.GetDatabase("SERVER", "mail.nsf") 
If Not Maildb.IsOpen = True Then 
Call Maildb.Open 
End If 
Set vw = Maildb.GetView("($inbox)") 
With vw 
x = 0 
ReDim LmailID(x) 
ReDim HasAttach(x) 
Set doc = .GetFirstDocument 
Set Item = doc.GetFirstItem("Body") 
Do 
If Item.Type = RICHTEXT Then  -  here i try take unread message and it doesnt work
fileNames = Session.Evaluate("@AttachmentNames", doc) 
For Each Filename In fileNames 
If Filename <> "" Then 
If Right(Filename, 3) = "bch" Then
Call doc.Save( False, True, True )
Set NotesEmbeddedObject = doc.GetAttachment(Filename) 
NotesEmbeddedObject.ExtractFile ("C:\" + Filename) 
Set reply = doc.CreateReplyMessage( False )
Call reply.replaceItemValue("Subject", "DONE" + subject)
Call reply.Send( False )
Set nextDoc = .GetNextDocument(doc)
Set doc = nextDoc
End If 
End If 
Next 
End If
x = x + 1 
ReDim Preserve LmailID(x) 
Set doc = .GetNextDocument(doc) 
Wscript.Sleep 500 
Loop Until doc Is Nothing 
End With 
Set Session = Nothing 
Set vw = Nothing 
Set doc = Nothing 
Set Item = Nothing 
Set Maildb = Nothing 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T21:25:53+00:00Added an answer on June 15, 2026 at 9:25 pm

    Some hints:
    Inside the loop you are using .GetFirstDocument. Move that outside the loop (outside With vw) and then use .GetNextDocument(doc) inside the loop (as you are already doing).

    Also, you are calling doc.Remove(True) and then later trying to fetch the next document by refering to the doc instance that you just deleted. To fix this, you can add another document instance such as nextDoc and then use this as a temporary document while you delete the doc instance:

    Before you delete doc:

    Set nextDoc = .GetNextDocument(doc)
    

    After you have deleted doc:

    Set doc = nextDoc
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

HTML has had frames from early days, but they are deprecated in the latest
It was easy with early ADT versions but now i can't find this function.
I read that early builds of Chrome supported ActiveX, but was later restricted to
I now its still early but I also know you guys are on top
Possible Duplicate: Function triggering early I have whipped up this code, but why on
I placed a text early in the html code for SEO reasons, but visually,
Early I posted a question about plotting county names on a map using ggplot
They say that early binding solves the problem of synchronization. I couldn't understand how.
In early phases of software development projects the conceptual data model is designed. In
Fairly early on in my app, when I was a lot less experienced than

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.