访问附件对话框窗口 [英] Access Attachment Dialog Window

查看:33
本文介绍了访问附件对话框窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用表单中的命令按钮打开以下链接中所示的窗口.有没有人可以告诉我怎么做?

I am trying to open the window pictured in the following link using a commmand button in a form. Is it possible that anyone can show me how to do that?

http://www.utteraccess.com/forum/Launching-附件-Dia-t1652872.html

先谢谢你!

推荐答案

我不确定您是否可以调用此特定对话框,但您可以做的是使用带有 FilePicker 选项的通用 FileDialog.然后使用该文件的路径保存并将特定文件复制到共享位置(可能也存储后端的某个位置).然后在您的表中,保存该新位置的路径.

I am not sure if you can call this specific dialog, but what you can do is use the generic FileDialog with the FilePicker option. Then save use that path to the file and copy the specific file to a shared location (probably somewhere where your backend is stored too). Then in your table, you save the path to that new location.

文件对话框的使用在帮助中有说明:

The use of the filedialog is explained in the help:

Sub Main()

    'Declare a variable as a FileDialog object.
    Dim fd As FileDialog

    'Create a FileDialog object as a File Picker dialog box.
    Set fd = Application.FileDialog(msoFileDialogFilePicker)

    'Declare a variable to contain the path
    'of each selected item. Even though the path is aString,
    'the variable must be a Variant because For Each...Next
    'routines only work with Variants and Objects.
    Dim vrtSelectedItem As Variant

    'Use a With...End With block to reference the FileDialog object.
    With fd

        'Use the Show method to display the File Picker dialog box and return the user's action.
        'The user pressed the button.
        If .Show = -1 Then

            'Step through each string in the FileDialogSelectedItems collection.
            For Each vrtSelectedItem In .SelectedItems

                'vrtSelectedItem is aString that contains the path of each selected item.
                'You can use any file I/O functions that you want to work with this path.
                'This example displays the path in a message box.
                MsgBox "The path is: " & vrtSelectedItem

            Next vrtSelectedItem
        'The user pressed Cancel.
        Else
        End If
    End With

    'Set the object variable to Nothing.
    Set fd = Nothing

End Sub 

通过 Google,我发现了这个(旧)主题给出了更多不在表中使用附件类型的理由(更新、插入、...查询不会那么容易工作,即).

And through Google, I came across this (old) topic giving even more reasons not to use the attachement type in your table (update, insert,... queries won't work that easily i.e.).

由于我关注了 David.W.Fenton 对我的回答的评论,因此我还建议您阅读 关于 SO 的以下主题.尤其是 Mitch Weath 的回答提供了一些关于将 Win32 API 用于打开文件对话框的额外信息.

Since I follow David.W.Fenton's comment on my answer, I would also recommend reading the following topic on SO. Especially the answer by Mitch Weath gives some extra information about using the Win32 API for the Open file dialog.

这篇关于访问附件对话框窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆