Solved

WORDBASIC dialogs GETFILENAME

Posted on 1997-05-26
2
192 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
ID: 1602684
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
ID: 1602685
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently Microsoft released a brand new function called CONCAT. It's supposed to replace its predecessor CONCATENATE. But how does it work? And what's new? In this article, we take a closer look at all of this - we even included an exercise file for…
How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …

730 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