Calling up a dialog box to Open a file 
Author Message
 Calling up a dialog box to Open a file

I have recorded macros before using the Recorder, but I have never tried to
insert VBA code into it ot do other functions.  I would like to create a
macro that starts with either Word's Open dialogue box, or another dialogue
box of some kind, so I can browse to select the document I want to open.
Also, the document will be a .TXT file.

I downloaded the Word VB Help file, and searched the Word MVP site, but I
guess I don't know enough about what I'm looking for to find it.

All help is appreciated.  Directions to any pages or sites that can help are
*greatly* appreciated!

Thank you for your time.

Ed



Mon, 12 Dec 2005 01:16:24 GMT  
 Calling up a dialog box to Open a file
Hi Ed,

I'd start with browsing the  material at the Word MVPs website
http://www.mvps.org/word/

For VBA FAQs have a look at http://www.mvps.org/word/FAQs/index.html and
click the Macros/VBA tab.

HTH


Quote:
> I have recorded macros before using the Recorder, but I have never tried
to
> insert VBA code into it ot do other functions.  I would like to create a
> macro that starts with either Word's Open dialogue box, or another
dialogue
> box of some kind, so I can browse to select the document I want to open.
> Also, the document will be a .TXT file.

> I downloaded the Word VB Help file, and searched the Word MVP site, but I
> guess I don't know enough about what I'm looking for to find it.

> All help is appreciated.  Directions to any pages or sites that can help
are
> *greatly* appreciated!

> Thank you for your time.

> Ed



Mon, 12 Dec 2005 01:41:15 GMT  
 Calling up a dialog box to Open a file
Found it.  Thank you.

Ed


Quote:
> Hi Ed,

> I'd start with browsing the  material at the Word MVPs website
> http://www.mvps.org/word/

> For VBA FAQs have a look at http://www.mvps.org/word/FAQs/index.html and
> click the Macros/VBA tab.

> HTH



> > I have recorded macros before using the Recorder, but I have never tried
> to
> > insert VBA code into it ot do other functions.  I would like to create a
> > macro that starts with either Word's Open dialogue box, or another
> dialogue
> > box of some kind, so I can browse to select the document I want to open.
> > Also, the document will be a .TXT file.

> > I downloaded the Word VB Help file, and searched the Word MVP site, but
I
> > guess I don't know enough about what I'm looking for to find it.

> > All help is appreciated.  Directions to any pages or sites that can help
> are
> > *greatly* appreciated!

> > Thank you for your time.

> > Ed



Mon, 12 Dec 2005 02:07:58 GMT  
 Calling up a dialog box to Open a file
Howdy Ed,

  You want to use a VBA function called "Dialogs".  It
takes a parameter to indicate which of many possible
dialogs to use (e.g. wdDilaogsFileOpen identifies the
dialog that you seem to want) and it has two methods that
you might want to know about. First, the .show method will
display the dialog, allow you to make your choices, then
it executes those choices.  However, if you want to show a
list of files without actually opening them, you can use
the .Display method.  Thus

Dialogs(wdDialogFileOpen).Show    - opens the selected file
Dialogs(wdDialogFileOpen).Display - does not

If you use the command as a function, it returns a value
indicating which button was used.  The two most used
values are
-2 = close
-1 = OK
 0 = Cancel

Marty  

Quote:
>-----Original Message-----
>I have recorded macros before using the Recorder, but I
have never tried to
>insert VBA code into it ot do other functions.  I would
like to create a
>macro that starts with either Word's Open dialogue box,
or another dialogue
>box of some kind, so I can browse to select the document
I want to open.
>Also, the document will be a .TXT file.

>I downloaded the Word VB Help file, and searched the Word
MVP site, but I
>guess I don't know enough about what I'm looking for to
find it.

>All help is appreciated.  Directions to any pages or

sites that can help are

- Show quoted text -

Quote:
>*greatly* appreciated!

>Thank you for your time.

>Ed

>.



Mon, 12 Dec 2005 11:49:35 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. How to call Open File and Save As dialog box API from VB

2. Open file dialog box and upload file

3. How to call the Explorer Open With dialog box

4. Calling File Open Dialog from VBA Attachments

5. call file open dialog

6. Call back procedure for open file common dialog (VB5)

7. Call back procedure for open file common dialog (VB5)

8. Call back procedure for open file common dialog (VB5)

9. File Open Dialog Box

10. Open File Dialog Box

11. Open File Dialog Box

12. File To Open Dialog box

 

 
Powered by phpBB® Forum Software