Private Sub Comando9_Click()
Boa tarde, preciso de ajuda, o modulo abaixo ja esta funcionando, o que eu nao estou acertando é que ele esta exportando apenas 1 grafico e eu tenho 3 graficos no formulario que eu queria exportar.
Dim wd As Object
Dim frm As Form
Dim ctl As Control
Set frm = Forms!frmGraficos
Set ctl = Forms!frmGraficos.Graph7
frm(ctl.Name).SetFocus
DoCmd.RunCommand acCmdCopy
With CreateObject("Word.Application")
.Visible = True
.Documents.Add
.Selection.PasteSpecial Link:=False, DataType:=wdPasteOLEObject, Placement _
:=wdInLine, DisplayAsIcon:=False
End With
End Sub
_________
os outros graficos são Graph8 e Graph9
________
Tentei colocar:
Dim wd As Object
Dim frm As Form
Dim ctl As Control
Dim ctl2 As Control
Dim ctl3 As Control
Set frm = Forms!frmGraficos
Set ctl = Forms!frmGraficos.Graph7
Set ctl2 = Forms!frmGraficos.Graph8
Set ctl3 = Forms!frmGraficos.Graph9
frm(ctl.Name).SetFocus
frm(ctl2.Name).SetFocus
frm(ctl3.Name).SetFocus
DoCmd.RunCommand acCmdCopy
With CreateObject("Word.Application")
.Visible = True
.Documents.Add
.Selection.PasteSpecial Link:=False, DataType:=wdPasteOLEObject, Placement _
:=wdInLine, DisplayAsIcon:=False
End With
Mas ele exporta apenas o Graph7....
Boa tarde, preciso de ajuda, o modulo abaixo ja esta funcionando, o que eu nao estou acertando é que ele esta exportando apenas 1 grafico e eu tenho 3 graficos no formulario que eu queria exportar.
Dim wd As Object
Dim frm As Form
Dim ctl As Control
Set frm = Forms!frmGraficos
Set ctl = Forms!frmGraficos.Graph7
frm(ctl.Name).SetFocus
DoCmd.RunCommand acCmdCopy
With CreateObject("Word.Application")
.Visible = True
.Documents.Add
.Selection.PasteSpecial Link:=False, DataType:=wdPasteOLEObject, Placement _
:=wdInLine, DisplayAsIcon:=False
End With
End Sub
_________
os outros graficos são Graph8 e Graph9
________
Tentei colocar:
Dim wd As Object
Dim frm As Form
Dim ctl As Control
Dim ctl2 As Control
Dim ctl3 As Control
Set frm = Forms!frmGraficos
Set ctl = Forms!frmGraficos.Graph7
Set ctl2 = Forms!frmGraficos.Graph8
Set ctl3 = Forms!frmGraficos.Graph9
frm(ctl.Name).SetFocus
frm(ctl2.Name).SetFocus
frm(ctl3.Name).SetFocus
DoCmd.RunCommand acCmdCopy
With CreateObject("Word.Application")
.Visible = True
.Documents.Add
.Selection.PasteSpecial Link:=False, DataType:=wdPasteOLEObject, Placement _
:=wdInLine, DisplayAsIcon:=False
End With
Mas ele exporta apenas o Graph7....
Última edição por vandernijs em 25/2/2012, 23:25, editado 1 vez(es)