Save as dialog that will work in word 2k and above

H

Hcoms

Hello,

Without using the commondialog what code can be written to display a "save
as" dialog box that will work in all verisons newer than word 2000.
In word 2k you can use application.getopenfilename and in xp and 2003 you
can use Application.FileDialog(msoFileDialogSaveAs).Show.

I have tried checking the verison of word that is running the code , however
it can not compile in 2003 when using getopenfilename. Any one have any
ideas please!!!!!
 
D

Doug Robbins - Word MVP

How about

Dialogs(wdDialogFileSaveAs).Show

--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
 
H

Hcoms

Thank you Doug!

How can you also only show folders ( i would also like the ability for them
to select the folder to where they wish to save the doc(s) , not to specifiy
the full path

Cheers
 
D

Doug Robbins - Word MVP

See the article “How to allow the user to browse to and select a folder” at:

http://word.mvps.org/FAQs/MacrosVBA/BrowsDialog.htm


or use this method originally posted by fellow MVP Jean-Guy Marcil

'_______________________________________
'Needs a reference to (Tools > Reference)
'Microsoft Shell Controls And Automation

Dim oShell As Shell32.Shell
Dim oFolder As Shell32.Folder
Dim EverythingOK As Boolean

EverythingOK = False

Set oShell = New Shell32.Shell
Set oFolder = oShell.BrowseForFolder(0, "Select ", 0)

On Error GoTo NoPath
MsgBox oFolder.Self.Path
EverythingOK = True

NoPath:
Set oFolder = Nothing
Set oShell = Nothing

If EverythingOK Then Exit Sub

On Error GoTo 0
MsgBox "Action cancelled by user.", vbExclamation, "Cancelled"
'_______________________________________

--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
 

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