Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How to copy attached file from a email public folders inbox

Posted on 2011-03-10
13
Medium Priority
?
477 Views
Last Modified: 2012-05-11
I can able copy the attached file from my inbox but I dont know how to copy attached file from a public folders inbox or other specific folder.Please advise what need to change the line below to achive the target I just explained.
Set Inbox = ns.GetDefaultFolder(olFolderInbox)
How to change the default folder as public folders inbox.

Your prompt response would be highly appreciated.
0
Comment
Question by:alam747
  • 7
  • 6
13 Comments
 
LVL 59

Expert Comment

by:Chris Bottomley
ID: 35105778
I no longer have access to public folders to prove but try

ns.GetDefaultFolder(olPublicFoldersAllPublicFolders).folders("inbox")
or less likely
ns.GetDefaultFolder(olPublicFoldersAllPublicFolders)

Chris
0
 

Author Comment

by:alam747
ID: 35112815
Thanks for your advice.
In fact I tried and with the code it works well  
Set Inbox = ns.GetDefaultFolder(olPublicFoldersAllPublicFolders).Folders("ttci expeditor")
but while I changed to
Set Inbox = ns.GetDefaultFolder(olMailbox621IndustrialSupplyPO).Folders("PO_FROM_JDE")
Its give me error "Could not complete the operation.One or more parameter values are not valid.
Please advice how to fix and copy the attached file from the mailbox folder PO_FROM_JDE").
Thanks in advance for your prompt reply.
0
 
LVL 59

Expert Comment

by:Chris Bottomley
ID: 35112915
Are ypou saying you have a PST:

olMailbox621IndustrialSupplyPO

if so then try:

application.Session.Folders("olMailbox621IndustrialSupplyPO").Folders("PO_FROM_JDE")

Use whatever the PST is displayed as in the outlook explorer ... but any subfolder path has to be broken down with the folder syntax for each level.

application.Session.Folders("olMailbox621IndustrialSupplyPO").Folders("PO_FROM_JDE").folders("anotherlevel").folders("Yet another level")


Chris
0
Learn Veeam advantages over legacy backup

Every day, more and more legacy backup customers switch to Veeam. Technologies designed for the client-server era cannot restore any IT service running in the hybrid cloud within seconds. Learn top Veeam advantages over legacy backup and get Veeam for the price of your renewal

 

Author Comment

by:alam747
ID: 35114442
Thanks I will try and let you know.
0
 

Author Comment

by:alam747
ID: 35133252
I used the way you advised it gave following error:
"Method or data member not found"
I defined like as below:
Dim Inbox As MAPIFolder
Set Inbox = Application.Session.Folders("olMailbox621IndustrialSupplyPO").Folders("PO_FROM_JDE")

Please advice whats the problem and how to fix it.

Thanks
0
 
LVL 59

Expert Comment

by:Chris Bottomley
ID: 35133291
olMailbox621IndustrialSupplyPO is meant to be whatever the PSt is called

Chris
0
 

Author Comment

by:alam747
ID: 35136729
Sorry its not clear to me, how to know that its a PST. in the outlook its like ..
mailbox- 621 Industrial Supply PO    and under that there inbox and other folder, one of them is PO-FROM-JDE where all attached file resides. I want to copy these attached file to a specific folder of hard disk.

Please advice what need to be changed or define to reach this folder.
Thanks for your co-operation.
0
 
LVL 59

Expert Comment

by:Chris Bottomley
ID: 35137132
In that case try:

Set Inbox = Application.Session.Folders("621 Industrial Supply PO").Folders("PO_FROM_JDE")
instead of
Set Inbox = Application.Session.Folders("olMailbox621IndustrialSupplyPO").Folders("PO_FROM_JDE")

If it still doesn't work then in the outlook explorer window select the root folder for the PST then select the VBE immediate window, (alt F11 followed by ctrl G) and in there type:

?application.ActiveExplorer.CurrentFolder.Name

And let me know what it returns

Chris
0
 

Author Comment

by:alam747
ID: 35141859
I tried but same error as before.
Would you explain more detail how to open outlook explorer and select the root folder ..

Thanks
0
 
LVL 59

Accepted Solution

by:
Chris Bottomley earned 2000 total points
ID: 35142794
In outlook itself you are trying to get the folder : mailbox- 621 Industrial Supply PO.

Select that folder then in the VBE do the other bits and return the output here as a paste of the text.

Chris
0
 

Author Closing Comment

by:alam747
ID: 35144186
Thanks a lot for prompt response whiich helps and work excellent.
0
 
LVL 59

Expert Comment

by:Chris Bottomley
ID: 35144811
You sussed the need to resolve the PST folder name so well done on making that final change yourself.

Glad to help
Chris
0
 

Author Comment

by:alam747
ID: 35146381
Thanks a lot for your advice. I appreciate your prompt response for the resolution.
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

As with any other System Center product, the installation for the Authoring Tool can be quite a pain sometimes. This article serves to help you avoid making these mistakes and hopefully save you a ton of time on troubleshooting :)  Step 1: Make sur…
Article by: Leon
Software Metering within our group of companies has always been an afterthought until auditing of software and licensing became a pain point. Orchestrator and SCCM metering gave us the answer and it was an exciting process.
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…

824 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