Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 575
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,163
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem using obj.Namespace(sourceFileName) Namespace(DestinationFilename).Itemsand then opening the xls file which creates a Temp Folder inside Temp Yuvraj Excel Discussion (Misc queries) 3 May 3rd 09 11:59 AM
Smart Documents - XSD and Namespace Paul Hasell Excel Programming 7 August 31st 05 06:07 PM
Pickfolder Method with Userform Steve[_63_] Excel Programming 0 August 31st 05 06:03 AM
Macro looking to Outlook for namespace. gobjob Excel Programming 1 July 26th 05 11:58 PM


All times are GMT +1. The time now is 08:58 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"