Solved

How to copy attached file from a email public folders inbox

Posted on 2011-03-10
13
472 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
Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

 

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 500 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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

Suggested Solutions

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…
Lync meeting or Lync conferencing is what many organizations would like to deploy to allow them save money. But companies are now giving up for various reasons, one of which is that they cannot join external meetings (non-federated company meetings)…
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…
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …

713 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