> |  
re : documento word
michele
Ecco un esempio, in pratica questo codice apre un doc word e ne aggiunge una immagine e poi chiude senza salvare, per aprire un documento credo basti richiamare il metodo oW.Documents.Open("percorso_e_nome_file")

Sub Click(Source As Button)
Const wdDoNotSaveChanges = 0
Dim oW As Variant, oD As Variant, vEmpty, FileName As String

On Error Goto eErrore

FileName = "C:\img.jpg"

Set oW = createobject("Word.Application")
oW.Visible = True
Sleep 1
Set oD = oW.Documents.Add()
Sleep 1
oD.Shapes.addpicture FileName, False, True, , , 100, 100
Sleep 1
If Isobject(oW) Then
oW.Quit wdDoNotSaveChanges
oW = vEmpty
End If

eFine:
Exit Sub

eErrore:
If Isobject(oW) Then
oW.Quit wdDoNotSaveChanges
oW = vEmpty
End If
Msgbox "Errore: " & Error(Err) & " numero: " & Err & " linea: " & Erl
Resume eFine
End Sub




documento word - marko -
    You are here re : documento word - michele -
    re : documento word - marko -