Add Favorites to Shortcut Bar in Save As Dialog Box

G

Guest

I'm using this code to bring up the Save As dialog box.

http://www.mvps.org/access/api/api0001.htm

It works great except for one thing I would like to add.

I would like the Icon shortcut for Favorites to show on the
shortcuts/favorites bar on the left side of the SaveAs dialog box. When I
use save as in Excel it always shows up.


--
Billy Rogers

Dallas,TX

Currently Using Office 2000
 
D

Douglas J. Steele

Yeah, unfortunately Ken's code's getting a little long in the tooth... <g>

Assuming you're using Windows 2000 or newer, replace the definition of
tagOPENFILENAME with:

Type tagOPENFILENAME
lStructSize As Long
hWndOwner As Long
hInstance As Long
lpstrFilter As String
lpstrCustomFilter As String
nMaxCustFilter As Long
nFilterIndex As Long
lpstrFile As String
nMaxFile As Long
lpstrFileTitle As String
nMaxFileTitle As Long
lpstrInitialDir As String
lpstrTitle As String
Flags As Long
nFileOffset As Integer
nFileExtension As Integer
lpstrDefExt As String
nCustData As Long
lpfnHook As Long
lpTemplateName As String
pvReserved As Long
dwReserved As Long
FlagsEx As Long
End Type

When you don't want the icons to appear, go into ahtCommonFileOpenSave and
inside the With OFN...End With, add

..FlagEx = 1
 
G

Guest

Douglas,

Thanks for the help. I am using windows 2000. The code change did not work.

I get a message box saying "method or data member not found" and
".strFilter" is highlighted

With OFN
.lStructSize = Len(OFN)
.hWndOwner = hwnd
.strFilter = Filter
--
Billy Rogers

Dallas,TX

Currently Using Office 2000 and Office 2003
 
D

Douglas J. Steele

Damn. Sorry about that: I forgot that I rewrote the declaration in my own
code. This should work:

Type tagOPENFILENAME
lStructSize As Long
hwndOwner As Long
hInstance As Long
strFilter As String
strCustomFilter As String
nMaxCustFilter As Long
nFilterIndex As Long
strFile As String
nMaxFile As Long
strFileTitle As String
nMaxFileTitle As Long
strInitialDir As String
strTitle As String
Flags As Long
nFileOffset As Integer
nFileExtension As Integer
strDefExt As String
lCustData As Long
lpfnHook As Long
lpTemplateName As String
pvReserved As Long
dwReserved As Long
FlagsEx As Long
End Type
 
G

Guest

Douglas,

I tried you code and I didn't get any error messages. The Save As dialog
box shows up, but it doesn't show the favorites icon.

It still shows History, Desktop, my computer, and my network
places..........no Favorites.


--
Billy Rogers

Dallas,TX

Currently Using Office 2000 and Office 2003
 
D

Douglas J. Steele

I never noticed that the Favorites doesn't show up in that Places bar that
the change causes to appear. The documentation at
http://msdn.microsoft.com/library/e...ce/commondialogboxstructures/openfilename.asp
says it should be there!

FlagsEx

Windows 2000/XP: A set of bit flags you can use to initialize the dialog
box. Currently, this member can be zero or the following flag.
OFN_EX_NOPLACESBAR

If this flag is set, the places bar is not displayed. If this flag is not
set, Explorer-style dialog boxes include a places bar containing icons for
commonly-used folders, such as Favorites and Desktop.


Sorry, I have no idea how to make it appear.
 
G

Guest

thanks for trying.
--
Billy Rogers

Dallas,TX

Currently Using Office 2000 and Office 2003
 

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