i have a form which displays 2 charts, i am able to export them to word document but i donot know how to paste them one after the other. currently they get printed one over the other.
here is the code :
here is the code :
Code:
Private Sub cmd_Print_Click()
Dim MyChartObj As Object
Dim MyLineObj As Object
Set MyChartObj = [Forms]![MainForm]![Sub_DisplayFm]![Graph_Chart]
Set MyLineObj = [Forms]![MainForm]![Sub_DisplayFm]![Graph_Line]
MyChartObj.SetFocus
DoCmd.RunCommand acCmdCopy
With CreateObject("Word.Application")
.Documents.Add
.Selection.PasteSpecial False, 0, 1, False '.Selection.PasteSpecial False, wdPasteOLEObject, wdFloatOverText, False
End With
MyLineObj.SetFocus
DoCmd.RunCommand acCmdCopy
With GetObject(, "Word.Application")
.Visible = True
.Selection.PasteSpecial False, 0, 1, False '.Selection.PasteSpecial False, wdPasteOLEObject, wdFloatOverText, False
End With
MsgBox "done"
End Sub