Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / February 2006

Tip: Looking for answers? Try searching our database.

common dialog control in word VBA

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Martin - 15 Feb 2006 10:42 GMT
Hi

I have written a macro that pulls data in from an excel sheet and puts
it in a word doc.

I want to allow the user to select which excel file they want to use by
ideally using the common dialog control to allow them to navigate to the
file they want.

Is there any way of doing this, particularly without using a form to
trigger the dialog control.
I have had a look round the net and it seems a WinAPI call(s) are required.

Any help would be appreciated.

Thanks

Martin
Jezebel - 15 Feb 2006 10:52 GMT
You don't have to display the form to use the commondialog on it. Put a
commondialog on a userform and you can use code like

With new frmMyForm
   With .CommonDialog1
       :
       .Show
    End with
End with

Users see only the dialog, not the form.

> Hi
>
[quoted text clipped - 15 lines]
>
> Martin
Jonathan West - 15 Feb 2006 11:35 GMT
Hi Martin,

You don't need to use the common dialog at all for this. If you are using
office XP or later, you can use the Application.FileDialog object to display
a dialog allowing the user to pick a file.

Signature

Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org

> Hi
>
[quoted text clipped - 15 lines]
>
> Martin
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.