File Association and passing file name of associated file to VB App 
Author Message
 File Association and passing file name of associated file to VB App

I can associate a file with my application.... not a problem

What I would like to do is open the file with my application and I need
to know what file opened my application.

I have a subroutine called

OpenSetupFile(SetupFileName As String)

so I need to know what file started my App so I can send it to this
subroutine to load it in.  The setup file is a user defined text file
used for step by step instructions for a process.

Thanks in advance.

Don Cessna
Hughes Space and Communications



Fri, 08 Jun 2001 03:00:00 GMT  
 File Association and passing file name of associated file to VB App
You have access within VB to the command  line that starts an VB app. Look
at the Command function.


Quote:
>I can associate a file with my application.... not a problem

>What I would like to do is open the file with my application and I need
>to know what file opened my application.

>I have a subroutine called

>OpenSetupFile(SetupFileName As String)

>so I need to know what file started my App so I can send it to this
>subroutine to load it in.  The setup file is a user defined text file
>used for step by step instructions for a process.

>Thanks in advance.

>Don Cessna
>Hughes Space and Communications



Fri, 08 Jun 2001 03:00:00 GMT  
 File Association and passing file name of associated file to VB App
Hello Don

If using an external ActiveX Dll is not overkill then
you may be able to use my FileProcess.dll at
http://www.bcsupernet.com/users/Murray/vbhomepage/fileprocess/index.htm
260+ functions for file, directory, drive, system, internet
operations. Win95 and Nt systems.

Best wishes, Murray

'Case 2 Launch the "c:\temp\aa.txt" via association
        Dim myFile as New clFile
        myFile = "c:\temp\aa.txt"
        myFile.AppShell  'starts notepad if associated with .txt

' Create an Association to a file extension
' Case 1 Associate notepad to all files with an
'    extension of .xzx
        Dim myFile as New clFile
        myFile = "notepad.exe"
        myFile.CreateAssociation "xzx"

' Get File Association
' Some files may have an associastion made to their extension
' i.e "c:\temp\myfile.txt" .txt may be associated with Notepad
' This function will extract that association if it exists
        Dim myFile as New clFile
        myFile = "c:\windows\system\commdlg.dll"
        MsgBox "Association=" & myFile.GetAssociation



Fri, 08 Jun 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. File Association Not Passing Long File Names to Command$

2. Running a file by its File association

3. File Explorer Help - Icon/File Associations

4. Opening a file using file type association

5. File Association/reading text file data

6. ************* load file in application via file association **************

7. File Name associations ?.exe

8. Starting with File Association and App is Running

9. Executing another app using the file association

10. Starting App with File By Association

11. Starting App with File By Association

12. Can't Get full File name for Long file names

 

 
Powered by phpBB® Forum Software