How To Refer To Custom Folder in VBA

Follow
Email
Hello Outlook Group:

I am trying to reference a CUSTOM user folder at the same level as all the 
other folders:

For example, I have a folder called MyEmails that appears in the Outlook 
tree as follows:

Calendar
Contacts
Deleted Items
Drafts
Inbox
MyEmails

The VBA code I'm using from Access works for the Inbox, but fails on the 
MAPI setup of the MyEmails Folder:

Set Inbox = OlApp.GetNamespace("Mapi").GetDefaultFolder(olFolderInbox)
Set MyEmailFolder = OlApp.GetNamespace("Mapi").Folders("MyEmail")

I don't want to the the GetDefaultFolder because it isn't one.  Does anyone 
know the code to create the Namespace for "MyEmail"?

Thanks,
Rich Locus


-- 
Rich Locus
Logicwurks, LLC
0
Reply Utf 5/8/2010 5:33:01 PM
outlook.program_vba 490 articles. 0 followers. Follow

1 Replies
957 Views

Similar Articles

[PageSpeed] 6
I finally came up with the code to do this... I had to refer to the Parent 
directory of the Inbox:

Set MyEmailFolder = 
OlApp.GetNamespace("Mapi").GetDefaultFolder(olFolderInbox).Parent.Folders("MyEmail")
-- 
Rich Locus
Logicwurks, LLC


"Rich Locus" wrote:

> Hello Outlook Group:
> 
> I am trying to reference a CUSTOM user folder at the same level as all the 
> other folders:
> 
> For example, I have a folder called MyEmails that appears in the Outlook 
> tree as follows:
> 
> Calendar
> Contacts
> Deleted Items
> Drafts
> Inbox
> MyEmails
> 
> The VBA code I'm using from Access works for the Inbox, but fails on the 
> MAPI setup of the MyEmails Folder:
> 
> Set Inbox = OlApp.GetNamespace("Mapi").GetDefaultFolder(olFolderInbox)
> Set MyEmailFolder = OlApp.GetNamespace("Mapi").Folders("MyEmail")
> 
> I don't want to the the GetDefaultFolder because it isn't one.  Does anyone 
> know the code to create the Namespace for "MyEmail"?
> 
> Thanks,
> Rich Locus
> 
> 
> -- 
> Rich Locus
> Logicwurks, LLC
0
Reply Utf 5/8/2010 5:49:01 PM
Follow
Email
Reply:
Similar Artilces:

custom pos buttons #3
Looking for an internal command to bring of the voucher(cnt shft f3)and refund..Downloaded qsbridge fireevent but cant find all of the commands..is there a complete list somewhere...thanks ...

Simple import/export of customization procedure in CRM 3.0
Hi I dont know whats the porblem but its not working, I added a few fields and tabs here and there, and also made some mapping ... published customizations and everything is OK, but when trying to import those customizations on to another server, it says import succesfull, but nothing changes. can some one give me the simple steps of exporting and then importing customizations?? -- Alaadin Abu Libdeh publish all entities then see if the changes appear ======================= John O'Donnell Microsoft CRM MVP http://codegallery.gotdotnet.com/crm "AbuLibdeh" <AbuLi...

Cell Value as Named Range Reference
Little bit of a quirky question... Trying to use a cell value as a reference in a formula, where that cell value is the name of a named range. So, assume A1:A3 is a named range: Rng1. And, B1:B3 is Rng2. I want to get the correlation vale for A1:A3 and B1:B3 So, cell D1 contains "Rng1" and D2 has "Rng2"; and cell D3 has the formula: =correl(D1,D2). But I get an error. Have also tried using Indirect to no avail. Any help would be hugely appreciated. Thank you. =CORREL(INDIRECT(D1),INDIRECT(D2)) -- Wigi http://www.wimgielis.be = Excel/VBA, soccer and music "ste...

Need to reference a block of cells from another sheet.
Dear All, apologies if this is probably a mundane question, but I didn't know what 'search terms' to put in google to return any results.. I've got a Spreadsheet with 12 tabs (sheets), I need part of tab 12 (sheet) to appear on tabs 1-11 (sheets), so that if I change data in tab 12 (sheet), tabs 1-11 (sheets) are changed too.. the cells themselves will never move location, just the data within them.. Is it possible? Regards Paul. On your sheet1 select the cell that should receive the data from Sheet12; Hold down the Shift key and Click on Sheet11 << this shoul...

refering to a name range area as a reference value multiple times on a worksheet at different locations
i was wondering if i had posted this in the right section as it could apply to both please could you take a look at the following post http://groups.google.com/group/microsoft.public.excel.misc/browse_thread/thread/f088a5737dd26570 thank you Is there some reason you can't post your question here instead of asking us to look elsewhere? -- Don Guillett Microsoft MVP Excel SalesAid Software dguillett@gmail.com "Blinds Nottingham" <bradrail.blinds.awnings@googlemail.com> wrote in message news:d8768e43-e035-45eb-856a-0ccdc843441d@g1g2000yqi.googlegroup...

Sent mail folder question for MVPs
I have two questions about Outlook, both related to having multiple mail accounts (e.g one Exchange and one IMAP). 1) Can I have mail from my imap account go to that accounts sent mail folder instead of the Exchange or default one? 2) Can I disable spam filtering for one account while allowing for another? 3) Can I have rules/filters on folders other than inbox? Thanks for any help. 1) Yes, but you need to use rules to move the mail by account and if it can't connect to the imap for some reason, no copy is saved. 2) No. 3) Only if you use Run Now. -- Diane Poremsky [MVP - O...

Outlook folder permissions.
Hello, At the company I work for, historically, the users have been changing the permissions on their folders manually to give PA only certain access. This has left me in a position of not knowing the permissions assigned for all my Exchange 5.5 mailboxes. Can somebody help me find a quick way to anayse Outlook folder permissions, similar to the showacls.exe command for NTFS persmissions? On a similar note, would there also be a way to change these permissions quickly rather than go through each and every folder.... theres a lot of folders!! Many thanks, Olly. ...

What is IVA# in Distribution Reference and Reference?
We did an inventory adjustment and now we get a unknown amount in Debit under the Inventory account and Credit for COGS account in the Transaction Entry Zoom. We're trying to figure out where that amount came from but we couldn't zoom more than what it's currently shown. In both fields, Reference and Distribution Reference, it's shown IVA#######... that is unknown to or setup by us in anywhere, i.e. Audit Trail, Source Document. Does this amount affect the dollar in the accounts mentioned? And can anyone please help to where we could drill down the IVA details?...

Adding new Public Folder Store and Replicating
I have two Exch2k3 servers in one site that I would like to store the same public folder information for redundancy sake. Currently one of my servers holds a copy of the public folders. How do I replicate the whole public folder structure over to the second server? Thanks! On Fri, 15 Apr 2005 17:21:03 -0700, "bj" <bj@discussions.microsoft.com> wrote: >I have two Exch2k3 servers in one site that I would like to store the same >public folder information for redundancy sake. Currently one of my servers >holds a copy of the public folders. How do I replicate th...

Custom Number Formats #2
How do I create a custom number format to return thousands e.g. if the value is 1000 the format shows 1 Under Format -> Cells in the Custom format box type #, (make sure you put the comma in). This will only show the thousands part, note that it will round numbers like 2598 up to 3 instead of 2. Andrea Jones http://www.allaboutoffice.co.uk http://www.stratatraining.co.uk http://www.allaboutclait.com "Mary Ann" wrote: > How do I create a custom number format to return thousands e.g. if the value > is 1000 the format shows 1 Try this custom number format: 0, Or: ...

macro button refers to prev. workbook?
Hi, When I create a macro in Excel, and assign a button to it, it works fine the first time, but when I re-open the workbook for a second time, and try to run the macro again, the macro seems to refer to the previous workbook...For some reason, the macro saves the name of the previous workbook... Sub test() ' Dim name As String Dim adress As String Sheets("sheet1").Select Range("A1").Select name = ActiveSheet.Range("B6").Value adress = ActiveSheet.Range("B4").Value ActiveWorkbook.SaveAs Filename:="C:\WINDOWS\Desktop\Temp...

Unable to edit custom dictionary within Word 2008
The first time I tried to edit my custom dictionary (I had accidentally entered a misspelled word) in Word 2008, the Edit button was available, but I was unable to click in and actually edit the list of words that came up. I temporarily gave up and resumed my spellcheck to finish the document. Then I tried again to edit the custom dictionary. Now the Edit button is dimmed, and the only way I can edit the custom dictionary is through the finder (by opening the file in a text editor). No matter which document I open or how many times I relaunch Word, this problem persists. Any suggestions? On...

code to search files and folders?
Hi need a code for a command button that will open the Search files and folders dialog? Can any one help? Which version are you using? maybe something like this: http://www.tek-tips.com/faqs.cfm?fid=4114 -- Maurice Ausum "jo" wrote: > Hi need a code for a command button that will open the Search files and > folders dialog? > Can any one help? Hi Maurice I am using access 2003 version. I have had a look at the code but can you tell me what code I need to call this code please. Jo "Maurice" wrote: > Which version are you using? &...

Custom Entity and its Relationship
Hi NG, Got a question and would appreciate anyone's help. Can a Custom Entity "Hardware Issues" have a parent or child relationship to itself? i.e., "Hardware Issues" to be a parent or child to "Hardware Issues". Many thanks in advance. Regards, Dixon Afraid not. Entities cannot reference themselves. Though CRM can handle it (like the parentaccountid in the account entity), it will not allow you to specify it by yourself. -- Michael http://www.stunnware.com/crm2 ---------------------------------------------------------- "Dix" <Dix@dis...

Custom shortcutmenu for commandbutton to open form with arguments
How does one create a custom shortcutmenu to set to a CommandButton that will open up a form passing in arguments from the current form, all in Access 2007 and VBA? Attached is some code that I use for a custom shortcut menu that I use on most of my forms. I call the subroutine when my Splash screen loads, and then use the click event of a control on my form (usually a label in the upper left corner of the form) to display the shorcut menu, using: CommandBars("MyFormMenu").ShowPopup What you will need to do is change the references to fnCloseForm to a new function th...

Column and Row reference
How do i hide the column and row reference number in a sheet, when viewing the worksheet i do not to show the top and right hand side references Dave Tools>Options>View. Uncheck "row and column headers". Good idea to spend a few minutes browsing through the various Tools>Options tabs to see what else is available to toggle on/off. Gord Dibben Excel MVP On Mon, 19 Jul 2004 15:53:02 -0700, "Dave" <Dave@discussions.microsoft.com> wrote: >How do i hide the column and row reference number in a sheet, when viewing the worksheet i do not to show the top an...

How to remove any public folder replication?
Hi all: [REAL-WORLD SCENARIO] There are a number of Exchange 5.5 servers on NT 4.0 platform in our organization. I'm at dept-A. Department-B is retiring one of their Exchange servers. [all Exch servers replicate data both ways]. I received an instruction to remove any public folder replication (from my Exch srvr) pointing to the retiring Exch srvr. On my Exch server, where do I look to find those replicating public folders? Appreciate any advice. --BOB "Bob" <anonymous@discussions.microsoft.com> wrote: >Hi all: > >[REAL-WORLD SCENARIO] >There ar...

Pulling all information from a custom entity into the Contact entity
I created a custom entity to hold meeting time, date and location. I then created a relationship to the Contact entity and put it in as a lookup. The problem is that the only information I can use in the Contact form is the name of the meeting. Time, date and location are not available for use in the Contact form, email templates or searches. It seems that this is a shortcoming of CRM, as I have seen that other people are wrestling with similar issues. But I have also heard that this can be handled via some custom coding (javascript?). Can anyone point me to possible solutions to ...

How to catch event onclick when user click on a PowerPoint VBA but
Hi all. You can visit this link : http://www.vbforums.com/showthread.php?t=510375 Like that application, I try to show a PPT file within a form by using FindWindow() and SetParent() Function of "user32.dll" by C#. I can catch events such as: begin show, end show, next slide, next, previous, next build... by build functions to handle that events (for a object of Micorosoft.Office.Interop.PowerPoint.SlideShowWindow) . It works ok. But if slide has a VBA button (to run a marco or show animation ...) or has a video clip and you need to click on it to play, I can not ca...

Missing References
I had a problem today with a missing reference - Microsoft Forms 2 on a colleague's machine at work (Office 2003; VBA 6.5; XP). I've read Chip Pearson's "Missing References in VBA" which is a geat explanation about how to fix problems like this. Oddly the library didn't seem to be flagged as "missing" and was in fact present in the system32 directory but didn't show up in the list of available references. Now to the questions: I'm not clear on whether if I write code in a project that references a library which is not part of the &qu...

Custom Report: Customer On-Account balance with running total
I need a custom report. - The report should show how an "Open Sales Invoice" (under account) has been paid and closed-out (e.g. how a multiple payment methods & references applied - payment, credits, returned). I badly need this report as it affects the capability of the customer on collecting A/R. I have seen numerous customer with "allegedly" open accounts called-us back stating that they already paid such open invoices (they even have a reference payment). I would like to have this simple statement format, as follows:- Date Type trans # ...

Can not customize outlook today #2
When I click on the Customize outlook today button nothing happens and I'm unable to select one of the other schemes. I'm using Outlook 2000 and Windows XP Home Does anyone have a fix to correct this issue? Thanks Gerry OL2000: You Cannot Customize Outlook Today After You Install Critical Update 813489 for Internet Explorer: http://support.microsoft.com/default.aspx?scid=kb;EN-US;820575 --� Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion intact. Due to the SWEN virus, all mail sent to my personal account will be deleted without reading. Af...

Reference
Is it possible to create a reference to another object such as: int & x = i; but using an image list, and referencing different objects depending on a condition? such as : CImageList & imageList; if (thumbnail == 1) imageList = m_ImageListThumb; else imageList = m_ImageListFullSize; Hope this makes sense! Ben You're better off using pointers for this. I believe, depending on the class, that what you're trying to will make a copy of the object instead of referencing it. "Ben Williamson" <oakdaleclose@googlemail.com> wrote in message news:43ee4603...

Macro to Reference Column Next to Current Reference
Hi, I'd like to automate the following procedure using a macro. Please help. 1) i have 2 sheets: Sheet1 & Sheet2 2) In Sheet1, Cells B2,D2,F2 has the formulas "=Sheet2! F2", "=Sheet2!K2", "=Sheet2!P2" correspondingly. 3) Every month when i do my work, i'd have to manually rekey the formulas to reference the subsequent columns, ie, Cell B2,D2,F2 will change from above to "=Sheet2! G2", "=Sheet2!L2", "=Sheet2!Q2" and in the following month, I have to change manually again to "=Sheet2! H2", "=Sheet2!M2&qu...

OE Folder/Address Book Retrival....
Hard Drive Damaged....Total Crash. Lost ALL Data. Was using XP OS and latest version of OE for email at the time. So, I upgraded with new Hard Drive and Installed Windows 7 Ultimate OS. Now using Windows Live Mail. My question is: Can I retrieve my lost folders that were established as part of OE on the left hand side of OE. Had many with much info stored. Same problem applies to address book that was in use with OE. I do not have any version of OE on my new OS at this point. -- mAllsbrook Thank You in Advance !! If your hard drive is damaged and you have lost all d...