Προς το περιεχόμενο

Erwtish gia VB6??????? (SOS!!!)


strbrdchild

Προτεινόμενες αναρτήσεις

Δημοσ.

Hizzz se olous, Exw ftiaxei mia efarmogh se vb h opoia sindeete parallila me sql server. To provlima mou einai oti thelw na anoigw kapoia word files (.doc) Ta opoia to path tous vriskete kratimeno ston sql serve se ena column. Thelw epilegwntas to sigekrimeno recordset afou exei emfanistei olo sto datagrid (ola ok ews edw aplo query itan ) na pataei o xrisths ena cmd button kai na to anoigei to sigekrimeno file. Any suggestion? any source code gia auto?

Δημοσ.

>
'At code module
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


'At Command_Click
   Const SW_SHOWNORMAL = 1
   iret = ShellExecute(Me.hwnd, vbNullString, "<full path to a file>", _
           vbNullString, "", SW_SHOWNORMAL)

 

Με αυτόν τον τρόπο μπορείς να ανοίξεις όποιο αρχείο θέλεις με το default πρόγραμμα

Δημοσ.

file userxp....thanks alla den katafera tpt!!!!!! o kwdikas mou einai o exis:

-----------------------------------------------------------------------------------

Option Explicit

 

Private WordServer As Word.Application

-----------------------------------------------------------------------------------

Private Sub cmdshcv_Click()

Dim file_name As String

Dim file_path As String

 

 

 

 

 

file_name = txtCV.Text

 

file_path = DataGrid1.Columns(6)

 

WordServer.Visible = True

 

WordServer.ChangeFileOpenDirectory file_path

WordServer.Documents.Open _

FileName:=file_title, _

ConfirmConversions:=False, _

ReadOnly:=False, _

AddToRecentFiles:=False, _

PasswordDocument:="", _

PasswordTemplate:="", _

Revert:=False, _

WritePasswordDocument:="", _

WritePasswordTemplate:="", _

Format:=wdOpenFormatAuto

End Sub

Mou crasharei omws sto wordserver as word.application

 

Den exw grapsei kwdika gia auto to shmeio sto module...

epishs exw tin lib twn office 9.0(opou einai gia 2000)....Mporeis na voithiseis????

Δημοσ.

epishs paizei kai o akolouthos kwdikas o opoios anoigei to word alla oxi to arxeio to opoio to path einai swsmeno se column mesa sto datagrid......

 

 

docspath = "C:\Program Files\Microsoft Office\OFFICE\winword.exe " & path

shell(docspath)

Δημοσ.
>
Option Explicit

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 cmdshcv_Click()
Dim file_name As String
Dim file_path As String
Private Const SW_SHOWNORMAL = 1

   file_name = txtCV.Text
   file_path = DataGrid1.Columns(6)

   Call ShellExecute(Me.hwnd, vbNullString, file_path & "\" & file_name, _
           vbNullString, "", SW_SHOWNORMAL)

End Sub

Αρχειοθετημένο

Αυτό το θέμα έχει αρχειοθετηθεί και είναι κλειστό για περαιτέρω απαντήσεις.

  • Δημιουργία νέου...