Results 1 to 7 of 7
  1. #1

    Default How to open a file in visual basic.


    Gud day mga bai..

    unsay code para maka open og isa ka file?..

    if windows executable file example, calculator, notepad, msdos , maka mao ko .. shell "notepad", vbNormalFocus

    pero kung file jud bai?..picture file (jpg format)
    unsaon na siya pag open?

    sa form naay command button, ig click nimo mo open og LOGO.jpg nga file
    if kani nga code Shell "G:\Filing\LOGO.jpg"
    dili man mo work sad..file not found ang error

    pls help thanks.

  2. #2

    Default Re: How to open a file in visual basic.

    suwayi ani
    shell "explorer.exe g:\filing\logo.jpg"

    pydi pud nimo ilisan ang explorer.exe to any program nga m support og file parameter.

  3. #3

    Default Re: How to open a file in visual basic.

    bro thanks alot! it really help

    cge nako search inet og code but layo ra kaayo..taas pa jud..thanks so much..

    ask ra niya ko balik..

  4. #4

    Default Re: How to open a file in visual basic.


    SHELL ra jud... vb6?

    SHELL "the filename"

    pwede pod OLE

    yeah! bling bling men...abz'

  5. #5

    Default Re: How to open a file in visual basic.

    The proper way of doing what you want is to use the ShellExecute API. I found an example from PSC:

    Private 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



    Private Sub xstart(xpath As String)


    If Dir(xpath) = "" Then
    Call MsgBox("The file does Not exist, check path In settings", vbExclamation)
    Exit Sub
    End If

    'open the file with the default program
    Call ShellExecute(hwnd, "Open", xpath, "", App.Path, 1)
    End Sub


  6. #6
    try command dialog components.

  7. #7
    commandDialog.showopen try lang bro.

  8.    Advertisement

Similar Threads

 
  1. how to fix bad files in hard drive
    By brad in forum Windows Software
    Replies: 8
    Last Post: 10-30-2010, 05:04 AM
  2. HELP: how to open .pdb file on mac? or convert .pdb to .pdf?
    By achibaby in forum Computer Hardware
    Replies: 1
    Last Post: 02-07-2010, 11:18 AM
  3. How to open VBS Script in Firefox
    By blackdronza in forum Programming
    Replies: 8
    Last Post: 06-09-2009, 08:02 AM
  4. HOW TO CONVERT .OTS file IN TO MP3??
    By Genocide in forum Software & Games (Old)
    Replies: 16
    Last Post: 04-15-2008, 11:33 PM
  5. how to attach a file in the thread? (help!)
    By vbrhitchz in forum Music & Radio
    Replies: 4
    Last Post: 10-21-2006, 11:00 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
about us
We are the first Cebu Online Media.

iSTORYA.NET is Cebu's Biggest, Southern Philippines' Most Active, and the Philippines' Strongest Online Community!
follow us
#top