?
Solved

Moving a doc into another folder using VB6

Posted on 2006-05-09
11
Medium Priority
?
287 Views
Last Modified: 2013-12-18
Hi Experts, well I got the code to read the inbox using VB
(http://www.experts-exchange.com/Applications/Email/Lotus_Notes_Domino/Q_21830123.html)
, it's for an account created only for that purpose and  I got manager rights over it, but I need now  to make a process that all incoming mails once are readed and transformed to a Pdf , to put theninto another folder and then to remove them, but it seems like its not working

so I was doing this
-------------------------------------------------------------------------------------------------------------------------
While Not doc Is Nothing
    If doc.Form = "Memo" Then
        Set rItem = doc.GetFirstItem("Body")
              CreatePdfDoc(rItem.Text) ' my own sub to create a pdf
       
         With rItem
                       
                       
                       
       End With
       
    End If
    Set docBefore = doc ' I set an object and reference it to move it
   
    Set doc = view.GetNextDocument(doc)

        With docBefore
            .PutInFolder "($TrashCain)", True  ' Testing Purpose  
            .RemoveFromFolder "($Inbox)"   '
        End With
 Wend

-----------------------------------------------------------------------------------

any help is always welcome


0
Comment
Question by:edwbear1976a
  • 6
  • 3
  • 2
11 Comments
 
LVL 15

Assisted Solution

by:mshogren
mshogren earned 480 total points
ID: 16643787
Are you receiving any errors?  Where does it fail?

Is the ($TrashCain) folder created?  It may be hidden but you can still see it in Domino Designer.

Are the documents getting put in this folder?
0
 
LVL 18

Accepted Solution

by:
marilyng earned 720 total points
ID: 16644026
Hi edwbear1976a,
> "($TrashCain)"
"($Trash)"  Is the correct folder, and the sytax is

with docBefore
   .putinFolder "($Trash)"

Regards!
0
 

Author Comment

by:edwbear1976a
ID: 16645443
Hi Experts and thanks for your advices
Mshogren:
<<Are you receiving any errors?  Where does it fail?
Nope, I don't receive any errors, I would like to recieve it to know where it fails
<<Is the ($TrashCain) folder created?  It may be hidden but you can still see it in <<Domino Designer.
well I don't know if the method created that folder with I never meant to creat a folder TrashCain , with that name I just meant the "Trash Folder" that already exits

marilyng :
>>> "($TrashCain)"
>>"($Trash)"  Is the correct folder
thank you,I was writing it wrong, that's why when I checket the Trash Folder I didin't see anything in it.

>> and the sytax is

>>with docBefore
>> .putinFolder "($Trash)"

Well  I referenced the Notes Library in my proyect  to know about the putinfolder method and to know about its parametters but  it says that there was another parameter that commands to create a folder in case that folder name doesn't exist.. that's why you see a boolean value..but anyhow it didn't work at all so I didn't see new folders creates .. I will follow your advice
Thank you very much, tomorrow morning I will test it in my job
ed
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 18

Assisted Solution

by:marilyng
marilyng earned 720 total points
ID: 16647541
If you put it in the trash folder, then it will be deleted, right?   whether or not you can create the folder in the mail file with the "true" parameter depends on your access to the mail file.

To see if it is running with errors, turn on debug mode and then run the agent.  If there is an error, the agent will stop at the error.

Also you can trap errors with:

On error goto Handle_Error


then add at end end of your sub:
======================================

'rest of stuff, but add an exit so your script doesn't run into your error routine...
Exit sub

Handle_Error:
  on Error goto 0
  msgbox "There was an error: " + error$ + "-" + str(err)
  exit sub

end sub

0
 

Author Comment

by:edwbear1976a
ID: 16649097
Ok ,thanks for the comments
well I 'm testing it right now  with my own account (the mail box of the account over I got full privileges  is empty now) with mails that are stored in the inbox (important mails  are always moved  to another folder before ) so they  are junk emails to me...

well for handling errors  I often use "On error resume next"  insteado "Goto" so that allows the application to move on  and in the end It debugs it instead of scaping it

 
 On error resume next
=======================================
'Code
   
If Err.Number > 0 Then 'at the bottom
            MsgBox Err.Number + " " + Err.Description
            Err.Number=0
End If
======================================

(I remember my Teacher always said that he was fully against the "Go to instructions".. well so maybe he was right or wrong)

but as I don't get messages this way I will try your way...

Thanks for your comments, I'm sure now it will work fine , I'm gonna try it right now  
0
 

Author Comment

by:edwbear1976a
ID: 16649491
Hi Maryling , thanks  for your comments ,it did work .. I mean it was  moved into the Trash box and then it was romoved .. but then I created a simple folder "WebOpt"  and I tried to do the same and it didn't move anything ... it was removed  but not moved....
so I guess I 'm missing something.. maybe is it about the folder properties? or something?

Thanks

Ed  


====================================
With beforeDoc
.PutInFolder "($WebOpt)"  ' if it's moved well I can't see it
  .PutInFolder "($Trash)"  ' it's moved, works fine
   .RemoveFromFolder "($Inbox)"  ' works fine
End With

====================================
0
 
LVL 15

Assisted Solution

by:mshogren
mshogren earned 480 total points
ID: 16649886
The problem may be that you are using hidden folders like ($WebOpt).  Try using a folder name like "Test" without the brackets.
0
 
LVL 18

Assisted Solution

by:marilyng
marilyng earned 720 total points
ID: 16653798
The last call is to trash, which would remove it from all other folders.

Your instructor may have been correct, but error trapping cannot be universally applied.  ON error resume next is not a good thing to do, for the most part.  You need to trap the error and decide if it's safe/prudent to "move next"  else you end up in a loop, or crashing the server, or your code not working at all because it's skipping the errors that you need to know about.



0
 

Author Comment

by:edwbear1976a
ID: 16658693
Hi mshgren, it did work fine, yeah thanks...
thank you marilying for your last comment and for all your help indeed
well now It's time to split points but first I gotta increase them...
Thank you guys...
0
 

Author Comment

by:edwbear1976a
ID: 16658719
===========
0
 

Author Comment

by:edwbear1976a
ID: 16658783
==========
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Problem "Can you help me recover my changes?  I double-clicked the attachment, made changes, and then hit Save before closing it.  But when I try to re-open it, my changes are missing!"    Solution This solution opens the Outlook Secure Temp Fold…
Notes Document Link used by IBM Notes is a link file which aids in the sharing of links to documents in email and webpages. The posts describe the importance and steps to create a Lotus Notes NDL file in brief.
Integration Management Part 2
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question