Welcome to Windows Help!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

VB Command

 
   Windows Help (Home) -> Microsoft Access RSS
Next:  automatically suppress Space Before after a colum..  
Author Message
Jasper Recto

External


Since: Dec 3, 2008
Posts: 2



(Msg. 1) Posted: Wed Jan 27, 2010 9:25 am
Post subject: VB Command
Archived from groups: microsoft>public>access (more info?)

I have a button that runs the function below. It opens an excel document.
I also have other funtion that opens up other documents whether it be a word
or pdf docuement.

This command opens each document in an explorer window.

How can I make a generic command that will open up the file in its native
program. That way an excel file will open in excel, etc...

Thanks,
Jasper



Function Administration()
Dim MyPath As String
Dim Word

MyPath = "\\LocFile\Departments\Quality
Control\Public\ISO-TS16949\ADMINISTRATION INDEX.xls\"
Word = Shell("Explorer.exe " & MyPath & """", 1)

End Function

 >> Stay informed about: VB Command 
Back to top
Login to vote
Daniel Pineault

External


Since: Feb 17, 2009
Posts: 5



(Msg. 2) Posted: Wed Jan 27, 2010 9:25 am
Post subject: RE: VB Command
Archived from groups: per prev. post (more info?)

see [URL="http://www.devhut.net/index.php?lang=en&pid=0000000011#openfile"]http://www.devhut.net/index.php?lang=en&pid=0000000011#openfile[/URL]

 >> Stay informed about: VB Command 
Back to top
Login to vote
Bernd Gilles

External


Since: Jan 27, 2010
Posts: 1



(Msg. 3) Posted: Wed Jan 27, 2010 11:25 am
Post subject: Re: VB Command
Archived from groups: per prev. post (more info?)

Hello Jasper,

Jasper Recto schrieb:
> How can I make a generic command that will open up the file in its native
> program. That way an excel file will open in excel, etc...

something like this?

Public Const WIN_NORMAL = 1 'Open Normal
Public Const WIN_MAX = 3 'Open Maximized
Public Const WIN_MIN = 2 'Open Minimized

Public Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long,
ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String,
ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

Sub TestEx
TheFile = "C:\YourPath\YourFile.pdf"
ShellExecute(hWndAccessApp, vbNullString, TheFile, vbNullString, vbNullString, WIN_MAX)
End Sub
 >> Stay informed about: VB Command 
Back to top
Login to vote
Lon_Hajduk

External


Since: Jan 27, 2010
Posts: 1



(Msg. 4) Posted: Wed Jan 27, 2010 12:25 pm
Post subject: Re: VB Command
Archived from groups: per prev. post (more info?)

"Jasper Recto" a écrit dans le message de

>I have a button that runs the function below. It opens an excel document.
>I also have other funtion that opens up other documents whether it be a
>word or pdf docuement.
>
> This command opens each document in an explorer window.
>
> How can I make a generic command that will open up the file in its native
> program. That way an excel file will open in excel, etc...
>
> Thanks,
> Jasper
>
>
>
> Function Administration()
> Dim MyPath As String
> Dim Word
>
> MyPath = "\\LocFile\Departments\Quality
> Control\Public\ISO-TS16949\ADMINISTRATION INDEX.xls\"
> Word = Shell("Explorer.exe " & MyPath & """", 1)
>
> End Function
>
 >> Stay informed about: VB Command 
Back to top
Login to vote
Jasper Recto

External


Since: Dec 3, 2008
Posts: 2



(Msg. 5) Posted: Thu Jan 28, 2010 12:09 pm
Post subject: Re: VB Command
Archived from groups: per prev. post (more info?)

Thanks everybody!
"Daniel Pineault" wrote in
message
> see [URL="http://www.devhut.net/index.php?lang=en&pid=0000000011#openfile"]http://www.devhut.net/index.php?lang=en&pid=0000000011#openfile[/URL]
> --
> Hope this helps,
>
> Daniel Pineault
> [URL="http://www.cardaconsultants.com/"]http://www.cardaconsultants.com/[/URL]
> For Access Tips and Examples: [URL="http://www.devhut.net"]http://www.devhut.net[/URL]
> Please rate this post using the vote buttons if it was helpful.
>
>
>
> "Jasper Recto" wrote:
>
>> I have a button that runs the function below. It opens an excel
>> document.
>> I also have other funtion that opens up other documents whether it be a
>> word
>> or pdf docuement.
>>
>> This command opens each document in an explorer window.
>>
>> How can I make a generic command that will open up the file in its native
>> program. That way an excel file will open in excel, etc...
>>
>> Thanks,
>> Jasper
>>
>>
>>
>> Function Administration()
>> Dim MyPath As String
>> Dim Word
>>
>> MyPath = "\\LocFile\Departments\Quality
>> Control\Public\ISO-TS16949\ADMINISTRATION INDEX.xls\"
>> Word = Shell("Explorer.exe " & MyPath & """", 1)
>>
>> End Function
>>
>>
>> .
>>
 >> Stay informed about: VB Command 
Back to top
Login to vote
eduardo freitas

External


Since: Jan 28, 2010
Posts: 1



(Msg. 6) Posted: Thu Jan 28, 2010 2:25 pm
Post subject: Re: VB Command
Archived from groups: per prev. post (more info?)

"Jasper Recto" escreveu na mensagem

>I have a button that runs the function below. It opens an excel document.
>I also have other funtion that opens up other documents whether it be a
>word or pdf docuement.
>
> This command opens each document in an explorer window.
>
> How can I make a generic command that will open up the file in its native
> program. That way an excel file will open in excel, etc...
>
> Thanks,
> Jasper
>
>
>
> Function Administration()
> Dim MyPath As String
> Dim Word
>
> MyPath = "\\LocFile\Departments\Quality
> Control\Public\ISO-TS16949\ADMINISTRATION INDEX.xls\"
> Word = Shell("Explorer.exe " & MyPath & """", 1)
>
> End Function
>
 >> Stay informed about: VB Command 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Command button?? - I have a database of a whole bunch of contacts..now what Im trying for now is to get like a box that pops up BEFORE the list of contacts comes up that is like a little search boc that will find a particular contact for me..get it? for instance when i....

Inactivate command button when no records - I have a subform that shows multiple records (notes) per client. In the subform header are navigation buttons including a button to create a new record. I have successfully programmed the buttons to disable when there is no more records in their directio...

Assigning a "Return" function to command button - I have a form with tab controls. Each tab has a sub-form. I designed the form and tabs to avoid scrolling. However, in one instance some minor scrolling will be needed to return to the top of the main form - no way around it. I was going to place a..

Implementing Save and Cancel command buttons on a form - I am having issues enabling and disabling Save and Cancel buttons on a form in continuous form view. I'm using the Dirty and Current events to enable and disable as the user tabs or clicks through records. (Works fine.) For cancel, I move the focus to..

Use a command button or label to hyperlink to an ftp:\anyn.. - I would like to use a command button or label on a form that would bring up IE explorer and ftp to a site I use to upload files to. I tried to use the url in the hyperaddress property but didnt work. Any help or work around would be greatly..
   Windows Help (Home) -> Microsoft Access All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]