Set initial folder for attachment dialog

U

Urs Ruefenacht

I launch the Insert File Dialog for adding attachments in my custom post
form with the following code:

Set objInsp = Item.GetInspector
Set colCB = objInsp.CommandBars
Set objCBB = colCB.FindControl(, 1079)
If Not objCBB Is Nothing Then
objCBB.Execute
End If
Set objCBB = Nothing
Set colCB = Nothing
Set objInsp = Nothing

Is it possible to set the initial folder for this dialog?

Thx in advance - cheers
oers
 
E

Eric Legault [MVP - Outlook]

Sorry, you can't change the initial folder location. If this is a must,
you'll have to either develop your own file chooser form or use the
FileDialog control (or Win32 API functions) on a User Form or custom Outlook
Form.
 
C

Craig

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User
Shell Folders\Personal

This key changes the default folder that windows uses and also outlook. It
would be super dirty, but you could change the registry entry before your
code executes then change it back.

the script would look like this.

Dim WSHShell
Set WSHShell = WScript.CreateObject("WScript.Shell")
WSHShell.RegWrite
"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User
Shell Folders\Personal", "<Folder you want to point to>"

Craig
 
C

Craig

Oops... Hit the wrong button on my first reply.

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User
Shell Folders\Personal

This key changes the default folder that windows uses and also outlook. It
would be super dirty, but you could change the registry entry before your
code executes then change it back.

the script would look like this.

Dim WSHShell
Set WSHShell = WScript.CreateObject("WScript.Shell")
WSHShell.RegWrite
"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User
Shell Folders\Personal", "<Folder you want to point to>"

Craig
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top