Dim Ruta As String
Ruta = AppPath() & "\prueba.doc"
Dim MSWord As New Word.Application
Dim Documento As Word.Document
MSWord.Documents.Open(Ruta)
MSWord.ActiveDocument.PrintOut()
MSWord.Documents.Close()
MSWord.Quit()
End sub
'Funcion AppPatch creada por el Guille
Public Function AppPath( _
Optional ByVal backSlash As Boolean = False _
) As String
Dim s As String = IO.Path.GetDirectoryName( _
GetExecutingAssembly.GetCallingAssembly.GetName.Co deBase.ToString)
' si hay que añadirle el backslash
If backSlash Then
s &= "\"
End If
Return s
End Function
Los trucos Visual Basic.NET más vistos
Este truco ha recibido 9 votaciones| Nota media: 6Selecciona tu
Puntuación: