我实在是没有办法了,请大家帮我把vb的代码转换成delphi的,谢谢了,我等着急用
Dim oWordApp
Dim oDoc
Dim oTable
Dim oLine
Dim oCell
Dim oShape,oGraphChart
On error resume next
Set oWordApp = CreateObject("Word.Application")
Set oDoc = oWordApp.Documents.Add
oWordApp.Visible = true
Const xlArea = 1
Const xlBar = 2
Const xlColumn = 3
'Const xlLine = 4
Const xlPie = 5
Const xlRadar = -4151
Const xlXYScatter = -4169
Const xlCombination = -4111
Const xl3DArea = -4098
Const xl3DBar = -4099
Const xl3DColumn = -4100
Const xl3DLine = -4101
Const xl3DPie = -4102
Const xl3DSurface = -4103
Const xlDoughnut = -4120
'Embed a chart on the document.
Set oShape = oDoc.Shapes.AddOLEObject("MSGraph.Chart")
Set oGraphChart = oShape.OLEFormat.object
oShape.Top = 100
With oGraphChart
.Width= 600
.Height = 400
.Top = 20
.Left = 20
.ChartArea.Font.Size = 8
.Application.Update
.ChartType = 'xlLine'
.HasTitle = True
.ChartTitle.Text = "Sales per Product"
.ChartTitle.Font.Size = 9
.ChartArea.AutoScaleFont = False
'Add data for the chart to the DataSheet in MSGraph.
With .Application.DataSheet.Cells.Clear
'Add the chart row labels.
.Cells(2, 1).Value = "Widgets"
.Cells(3, 1).Value = "Gadgets"
.Cells(4, 1).Value = "Gizmos"
'Add the chart column labels.
.Cells(1, 2).Value = "1999"
.Cells(1, 3).Value = "2000"
'Add data to the chart.
Dim r , c
For r = 2 To 4
For c = 2 To 3
.Cells(r, c).Value = Rnd() * 100000
Next
Next
End With
.Application.Update 'Update the changes
.Application.Quit 'and deactivate the chart.
End With
'Clean up.
Set oGraphChart = Nothing
Set oShape = Nothing
Set oDoc = Nothing
Set oWordApp = Nothing
Dim oWordApp
Dim oDoc
Dim oTable
Dim oLine
Dim oCell
Dim oShape,oGraphChart
On error resume next
Set oWordApp = CreateObject("Word.Application")
Set oDoc = oWordApp.Documents.Add
oWordApp.Visible = true
Const xlArea = 1
Const xlBar = 2
Const xlColumn = 3
'Const xlLine = 4
Const xlPie = 5
Const xlRadar = -4151
Const xlXYScatter = -4169
Const xlCombination = -4111
Const xl3DArea = -4098
Const xl3DBar = -4099
Const xl3DColumn = -4100
Const xl3DLine = -4101
Const xl3DPie = -4102
Const xl3DSurface = -4103
Const xlDoughnut = -4120
'Embed a chart on the document.
Set oShape = oDoc.Shapes.AddOLEObject("MSGraph.Chart")
Set oGraphChart = oShape.OLEFormat.object
oShape.Top = 100
With oGraphChart
.Width= 600
.Height = 400
.Top = 20
.Left = 20
.ChartArea.Font.Size = 8
.Application.Update
.ChartType = 'xlLine'
.HasTitle = True
.ChartTitle.Text = "Sales per Product"
.ChartTitle.Font.Size = 9
.ChartArea.AutoScaleFont = False
'Add data for the chart to the DataSheet in MSGraph.
With .Application.DataSheet.Cells.Clear
'Add the chart row labels.
.Cells(2, 1).Value = "Widgets"
.Cells(3, 1).Value = "Gadgets"
.Cells(4, 1).Value = "Gizmos"
'Add the chart column labels.
.Cells(1, 2).Value = "1999"
.Cells(1, 3).Value = "2000"
'Add data to the chart.
Dim r , c
For r = 2 To 4
For c = 2 To 3
.Cells(r, c).Value = Rnd() * 100000
Next
Next
End With
.Application.Update 'Update the changes
.Application.Quit 'and deactivate the chart.
End With
'Clean up.
Set oGraphChart = Nothing
Set oShape = Nothing
Set oDoc = Nothing
Set oWordApp = Nothing
解决方案 »
- 一个console如何播放网上的mp3歌曲
- NT/XP 下如何知道系统从一开始起动总共运行了多少进程?
- 如何把TXMLDocument的内容转化为String
- 请教:用Query查询显示的表格,更新的时候鼠标指针变为沙漏加SQL字样的样子,能改成标准沙漏吗?
- 要在listview的columns中插入一个item应该怎么做?
- 有TForm的初始化方法嗎?
- 这个SQL语句怎么写
- 我已经能够控制MU网络的进出数据,进行了初步的分析,需要帮忙!
- 急,动态数组的问题。
- 请教一个简单的问题:dbgrid中的某几列能否控制为只读?若能,如何控制?急!
- cxGrid分组统计问题
- 高分求助,将单字节数字写入双字内并且低位写在首字节!
SET相当于:=,剩下的自己看着办吧