Help with Open dialog please 
Author Message
 Help with Open dialog please

In a follow up to my earlier post re the possibility of
setting multiple file types (ie *.doc + *.rtf) in the
oopen file dialog I have tried to get around this with a
user form that offers 2 option boxes for DOC or RTF and a
GO button to load the dialog.

What I have for the GO button code is:

Private Sub btnGo_Click()
 Dim sName As String
 With Me
  .Hide
   If .optRTF.Value Then
    sName = "*.rtf"
   Else
    sName = "*.doc"
   End If
    With Dialogs(wdDialogFileOpen)
       .Name = sName
       .Show
    End With
 End With
End Sub

but despite the fact that the sName variable  and .Name
get set as expected the dialog box when shown only offers
the last file type set using Open in the normal way rather
than .rtf or .doc as set in the code above.

Can anyone suggest why?



Sat, 31 Dec 2005 15:30:30 GMT  
 Help with Open dialog please
Hi Alan,

Works fine for me (Word2000).
"*.doc" / "*.rtf" doesn't appear in the name field (probably because both
are known file types), but only files of the respective type are displayed.

Are you using Word2002/2003? The support for the built-in dialogs has
become worse and worse with each new version, and I wouldn't be surprised
at a new bug.

Regards,
Klaus

Quote:

> In a follow up to my earlier post re the possibility of
> setting multiple file types (ie *.doc + *.rtf) in the
> oopen file dialog I have tried to get around this with a
> user form that offers 2 option boxes for DOC or RTF and a
> GO button to load the dialog.

> What I have for the GO button code is:

> Private Sub btnGo_Click()
>  Dim sName As String
>  With Me
>   .Hide
>    If .optRTF.Value Then
>     sName = "*.rtf"
>    Else
>     sName = "*.doc"
>    End If
>     With Dialogs(wdDialogFileOpen)
>        .Name = sName
>        .Show
>     End With
>  End With
> End Sub

> but despite the fact that the sName variable  and .Name
> get set as expected the dialog box when shown only offers
> the last file type set using Open in the normal way rather
> than .rtf or .doc as set in the code above.

> Can anyone suggest why?



Sun, 01 Jan 2006 03:13:30 GMT  
 Help with Open dialog please
Klaus
re >Are you using Word2002/2003?
I am using Word97 at present.

Interestingly it will work to change to RTF the first time
it is run, but if run again steadfastly refuses to change
from RTF to DOC.

I am being lazy really. I generally use DOC, but have RTF
export files from other software that I want to open and
carry out tasks.

All I really wanted to do was to set the open file type to
DOC or RTF by default (and not with ANY FILES) but it
seems you can only have one or the other. My get around
was to have this little userform to select which type.

So it really all comes from me not wanting to change the
file type from the open dialog that comes up in the usual
way and defaults to the last file type. Stupid really, but
hey!!?



Sun, 01 Jan 2006 18:44:27 GMT  
 Help with Open dialog please
Hi Alan,

Played around some more, but both "*.doc;*.rtf" to show files of both kinds
and "*.rtf" / "*.doc" to show either kind work nicely here (Word2000).

Especially with the latter I can't imagine a bug in Word97, since this
would be well known.

You might try an ".Update" before the ".Display"/".Show".

Or you might try if the code works if you don't run it from the user form.

Good luck!
Klaus



Quote:
> Klaus
> re >Are you using Word2002/2003?
> I am using Word97 at present.

> Interestingly it will work to change to RTF the first time
> it is run, but if run again steadfastly refuses to change
> from RTF to DOC.

> I am being lazy really. I generally use DOC, but have RTF
> export files from other software that I want to open and
> carry out tasks.

> All I really wanted to do was to set the open file type to
> DOC or RTF by default (and not with ANY FILES) but it
> seems you can only have one or the other. My get around
> was to have this little userform to select which type.

> So it really all comes from me not wanting to change the
> file type from the open dialog that comes up in the usual
> way and defaults to the last file type. Stupid really, but
> hey!!?



Sun, 01 Jan 2006 19:01:15 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP,

2. Open file Dialog Box in Access..Please Help

3. help please - file open dialog

4. Please Help opening a database via common dialog

5. Having problem with Common Dialog Font Dialog - Please Help

6. Can anyone HELP me PLEASE PLEASE PLEASE PLEASE PLEASE PLEASE PLEASE PLEASE PLEASE

7. Please, please help - VB6 opening and reading a project mpp file

8. open dialog or save dialog

9. Standard Dialogs: Need open dialog in Access

10. Centering a Open Dialog box using the Common dialog

11. Common Dialog's File Open dialog question

12. PLEASE HELP PLEASE HELP PLEASE HELP

 

 
Powered by phpBB® Forum Software