Set initial folder for attachment dialog

  • Thread starter Thread starter Urs Ruefenacht
  • Start date Start date
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
 
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.
 
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
 
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
 
Back
Top