Solved

WORDBASIC dialogs GETFILENAME

Posted on 1997-05-26
2
187 Views
Last Modified: 2012-05-04
I am programming a WordBasic macro for Word 6.0c. In there, I display a custom dialog box to ask the user different options. One of the options is the file name (and path) of a mailing list to where the document has to be send at the end of the macro. Is it possible to provide the user with the 'browse' style to go and look for this filename within the macro dialog?

Thanks in advance,

eric debruyne
european commission
debruer@dg1.cec.be
0
Comment
Question by:debruer
2 Comments
 
LVL 2

Accepted Solution

by:
Llandr earned 100 total points
Comment Utility
This code shows a dialog box that allows you to open an Excel file. After this it opens the Excel file, I hope this is what you were looking for.


Public Sub MAIN()
Dim x
Dim GetXcelFilename
    Dim dlg As Object: Set dlg = WordBasic.DialogRecord.FileOpen(False)

    WordBasic.CurValues.FileOpen dlg
    dlg.Name = "*.xls"
    x = WordBasic.Dialog.FileOpen(dlg)
    GetXcelFilename = dlg.Name
End Sub

0
 

Author Comment

by:debruer
Comment Utility
Llandr,
Thanks for commenting. What you suggest doesn't quite work on my Word 6.0c but I manage to make it work. It isn't quite what I want to do though. I don't want to open the file, just want the user to select it and the dialog should leave me the name (and path) of the file to use as a mailing list in our mail-program. Preferably, I would like this browse-operation INSIDE another custom dialog but, since I think this isn't possible, I'd settle for a way to retrieve the filename without Word trying to open it.

Any solutions?

eric
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Introduction Perhaps more familiar to developers who primarily use VBScript than to developers who tend to work only with Microsoft Office and Visual Basic for Applications (VBA), the Dictionary is a powerful and versatile class, and is useful …
In this article we discuss how to recover the missing Outlook 2011 for Mac data like Emails and Contacts manually.
The viewer will learn how to  create a slide that will launch other presentations in Microsoft PowerPoint. In the finished slide, each item launches a new PowerPoint presentation and when each is finished it automatically comes back to this slide: …
Learn how to create and modify your own paragraph styles in Microsoft Word. This can be helpful when wanting to make consistently referenced styles throughout a document or template.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now