Macro/DialogBox/UserForm?

S

Sharon

I have searched macros, dialog boxes and user forms but can't seem to find
exactly what I need.

Basically, I want to create a macro that will
stop,
open a directory,
let you choose the directory name,
and then open a dialog box(?)/userform(?) where you can type in the document
you need,
choose "OK"
and it will close the dialog box/user form and insert the document into the
active document.
 
D

Doug Robbins - Word MVP

I believe that the following command does everything that you want:

Dialogs(wdDialogInsertFile).Show


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
S

Sharon

This is great! However, I would like to know if it can go one step further.
Is it possible to direct it to a particular directory? For instance, this
opens to the "My documents", but can you code it so that it opens to a
particular network directory i.e., \\networkdir\corporate\patents\? Then I
would like to select the file to insert from that directory?
 
E

Ed

Sharon said:
Is it possible to direct it to a particular directory?

Try using
ChangeFileOpenDirectory "\\networkdir\corporate\patents\"
Application.Dialogs(wdDialogInsertFile).Show

HTH
Ed
 
S

Sharon

Worked like a charm! Thanks.
--
S


Ed said:
Try using
ChangeFileOpenDirectory "\\networkdir\corporate\patents\"
Application.Dialogs(wdDialogInsertFile).Show

HTH
Ed
 

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