edwbear1976a
asked on
Moving a doc into another folder using VB6
Hi Experts, well I got the code to read the inbox using VB
(https://www.experts-exchange.com/questions/21830123/VB-code-for-Accessing-Lotus-Notes-Mail-Box-database-to-transfer-the-content.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
(https://www.experts-exchange.com/questions/21830123/VB-code-for-Accessing-Lotus-Notes-Mail-Box-database-to-transfer-the-content.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
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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
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
ASKER
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
========================== ==========
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
==========================
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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...
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...
ASKER
===========
ASKER
==========
ASKER
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