Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
namespace.pickfolder
hi all
if i get a user to pick an outlook folder with the namespace.pickfolder method, how can I make that folder object available across all my macros - i need to refer to it again in some userform.dblclick events i don't want the make the user select a folder each time I want to refer to it any help appreciated, new to vba tia steve |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
namespace.pickfolder
Steve,
You could save it in the registry. In subsequent routines, if there is a registry entry, then use it, otherwise prompt for the folder. Have a look at savesetting and getsetting in the help files. Robin Hammond www.enhanceddatasystems.com "Steve" wrote in message ... hi all if i get a user to pick an outlook folder with the namespace.pickfolder method, how can I make that folder object available across all my macros - i need to refer to it again in some userform.dblclick events i don't want the make the user select a folder each time I want to refer to it any help appreciated, new to vba tia steve |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
namespace.pickfolder
No need to monkey with the registry unless you want the selection to be saved
as a user setting (e.g. will be saved even if Excel closed or computer is shut down). Simpler: make the folder into a Public (global) variable; then you can access it from other routines (even in other modules); e.g: Public SelectedFolder as MAPIFolder Sub FolderPick() ' This would be the routine where the user picks the folder Set SelectedFolder = ... End Sub Sub UserForm_DblClick(ByVal Cancel As MSForms.ReturnBoolean) ' This sub can use SelectedFolder as an object variable; if called after the FolderPick sub, SelectedFolder will contain the folder chosen in FolderPick End Sub -- - K Dales "Steve" wrote: hi all if i get a user to pick an outlook folder with the namespace.pickfolder method, how can I make that folder object available across all my macros - i need to refer to it again in some userform.dblclick events i don't want the make the user select a folder each time I want to refer to it any help appreciated, new to vba tia steve |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Problem using obj.Namespace(sourceFileName) Namespace(DestinationFilename).Itemsand then opening the xls file which creates a Temp Folder inside Temp | Excel Discussion (Misc queries) | |||
Smart Documents - XSD and Namespace | Excel Programming | |||
Pickfolder Method with Userform | Excel Programming | |||
Macro looking to Outlook for namespace. | Excel Programming |