Visual Basic - Urgente Word-VB6

Life is soft - evento anual de software empresarial
 
Vista:

Urgente Word-VB6

Publicado por Altapy (7 intervenciones) el 03/06/2005 12:14:02
Hola gente

Estoy haciendo un proyecto y necesito sacar a un documento de word los datos q tengo en unos textbox y grids dentro de un formulario un formulario y no tengo ni pajolera idea de como hacerlo si alguien fuera tan amable de explicarme como se hace o q me mandara un proyecto donde se haga algo pareccido le estaria muy agradecido a el y a todos los q intenten ayudarme.

Muxas gracias

* Si alguien me kiere mandar el proyecto porfavor a este correo [email protected]
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:Urgente Word-VB6

Publicado por Harold (104 intervenciones) el 03/06/2005 17:21:55
'Necesitas un mshflexgrid conectado a datos........

Dim wdapp As Object
Dim i As Integer

Private Sub Command1_Click()

Set wdapp = CreateObject("Word.application")
wdapp.Application.Visible = True
wdapp.Application.Documents.Add DocumentType:=wdNewBlankDocument
wdapp.Activate

With wdapp.Application.ActiveWindow
.Selection.TypeText Text:="Bienvenido a Microsoft Word"
.Selection.TypeParagraph
.Selection.TypeParagraph
.Selection.TypeText Text:=Format(Date, "Long Date")
.Selection.ParagraphFormat.Alignment = wdAlignParagraphRight
.Selection.TypeParagraph
.Selection.TypeParagraph
.Selection.ParagraphFormat.Alignment = wdAlignParagraphLeft
.Selection.TypeText Text:="Pedido: " & Text1.Text
.Selection.TypeParagraph
.Selection.TypeParagraph
.Selection.TypeText Text:="CODIGO "
.Selection.Font.Bold = wdToggle
.Selection.TypeText Text:="CLIENTE CONTACTO"
.Selection.Font.Bold = wdToggle
.Selection.TypeParagraph
.Selection.TypeParagraph

'cambia el estilo de letra
With .Selection.Font
.Name = "Courier New"
.Size = 12
.Bold = False
.Italic = False
.Underline = wdUnderlineNone
.UnderlineColor = wdColorAutomatic
.Color = wdColorAutomatic
End With

'Inserta los datos del MsHFlexGrid se supone que este ejemplo tiene 3 columnas
For i = 1 To MSHFlexGrid1.Rows - 1
CODIGO = MSHFlexGrid1.TextMatrix(i, 0)
cliente = MSHFlexGrid1.TextMatrix(i, 1)
contacto = MSHFlexGrid1.TextMatrix(i, 2)
.Selection.TypeText Text:=CODIGO & Space(6 - Len(CODIGO)) & cliente & Space(35 - Len(cliente))
.Selection.Font.Bold = wdToggle
.Selection.TypeText Text:=contacto
.Selection.Font.Bold = wdToggle
.Selection.TypeParagraph
Next

With .Selection.Font
.Name = "Times New Roman"
.Size = 12
.Bold = False
.Italic = False
.Underline = wdUnderlineNone
.UnderlineColor = wdColorAutomatic
.Color = wdColorAutomatic
End With

End With


End Sub

'Espero te ayude............
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar