RE:Abrir documento de Word
Publicado por
Luis Tobar (1 intervención) el 18/05/2001 13:52:49
Dim WordObj As Word.Application
Dim WordDoc As Word.Document
Dim WordRange As Word.Range
Set WordObj = CreateObject("Word.Application")
Set WordDoc = WordObj.Documents.Open(App.Path & "\" & "Documento1.doc")
Set WordRange = WordDoc.GoTo(What:=wdGoToBookmark, Name:="M01")
WordRange.InlineShapes.AddPicture App.Path & "\" & "Foto1.jpg"
'---
Set WordRange = WordDoc.GoTo(What:=wdGoToBookmark, Name:="M02")
WordRange.InsertBefore txtText1
ActivePrinter = "\\srv-sna\Lexmark Optra T616"
WordDoc.PrintOut Background:=False
'Repone impresora predeterminada habitual
ActivePrinter = "\\srv-sna\Lexmark Optra T616"
DoEvents 'Ejecuta mensajes de otras aplicaciones
WordObj.Quit SaveChanges:=wdDoNotSaveChanges
Set WordObj = Nothing