都这么晚了,你也还在工作啊,
看看我的贴好吗我也遇到了问题
(一个在vba,一个在数据库)?明天我要向老总交代,要不帮帮我想想怎么打发老总,真的好想睡觉,我都20多个小时没有合眼了
看看我的贴好吗我也遇到了问题
(一个在vba,一个在数据库)?明天我要向老总交代,要不帮帮我想想怎么打发老总,真的好想睡觉,我都20多个小时没有合眼了
解决方案 »
- vsflexgrid 表格内容如何向水晶报表中输入数据实现预览打印
- 求助:怎样用vb实现列网站目录和文件!???
- 关于字符串的无缝合并,请高手指点。
- 请教各位大侠!关于数据库的
- vb中不同窗体间是如何传递变量值的
- VB工程组的问题?
- 请教各位vb达人一个小小的问题,急!!!!!!!!
- 用 FileSystemObject 打开的 TXT 文件怎样才能删除一行 ??? 谢谢!!
- 新手关于EXCEL的问题——急盼指导!!!
- 如何自动改变textbox中字体的大小,来适用textbox的长度
- 如何象Flashget那样迅速生成一个指定大小的文件
- 我做了一个数据库,新添加的数据在删除没有问题,可是以前数据库有的数据却不能删除,请问为什么?
MSDN 对 EXCEL 和 WORD 支持最强。
up up up upupupup upupupup up up
up up upup up up up up up up
up up up up up up up up up up
up up up up up up up up up up
upupupupup upupupupup up up up up upup
up up up up upupupup upupupup up
up up up up up up up
up up up up up up up
up up up up up up up
VB中不是有一个OLE控件吗?用它就可以了啊
通过ole控件
现在是给ole加滚动条:
先插入一个picturebox,在picturebox中放一个ole 控件,在sizemode中设为
2-autosize。
然后写入下列代码:
Private Sub HScroll1_Change()
OLE1.Left = -HScroll1.Value
End Sub
Private Sub VScroll1_Change()
OLE1.Top = -VScroll1.Value
End Sub
Private Sub Command1_Click()
HScroll1.Value = 0
VScroll1.Value = 0
With OLE1
.CreateLink ("c:\My Documents\111.dot")
HScroll1.Max = .Width - Picture1.Width + 20
HScroll1.LargeChange = .Width / 10
HScroll1.SmallChange = .Width / 20
VScroll1.Max = .Height - Picture1.Height + 20
VScroll1.LargeChange = .Height / 10
VScroll1.SmallChange = .Height / 20
End With
End Sub
下面是插入word :
Private Sub Command1_Click() Set appWord = CreateObject("Word.Application")
appWord.Visible = False
Set docWord = appWord.Documents.Open("D:111.dot")
Set tblWord = docWord.Tables.Item(1)
tblWord.Cell(12, 1).Range.Text = Form1.Text34.TextdocWord.Save
docWord.Close
appWord.Quit
Set docWord = Nothing
Set appWord = Nothing
end sub
Private Sub Form_Load()
Dim wordobj As Object
HScroll1.Value = 0
VScroll1.Value = 0
With OLE1
.CreateLink ("D:\111.dot") 'Text1.Text内容可设为c:\myexcel.xls等
.DoVerb
.Action = 7
.object.Application.Visible = False
HScroll1.Max = .Width - Picture1.Width + 20
HScroll1.LargeChange = .Width / 10
HScroll1.SmallChange = .Width / 20
VScroll1.Max = .Height - Picture1.Height + 20
VScroll1.LargeChange = .Height / 10
VScroll1.SmallChange = .Height / 20
End With
End SubPrivate Sub Form_Unload(Cancel As Integer)
OLE1.object.Application.Quit
End Sub
Private Sub HScroll1_Change()
OLE1.Left = -HScroll1.Value
End Sub
Private Sub VScroll1_Change()
OLE1.Top = -VScroll1.Value
End Sub
用vb 先建一个c:\temp.doc
Dim myword As New Word.Application
Dim mydocument As Document
Const Maxlines = 100000 '定义最大行数Private Sub Command1_Click()
Set mydocument = myword.Documents.Open("c:\temp.doc")With myword
.Selection.MoveDown Unit:=wdLine, Count:=Maxlines
.Selection.InsertRows
.Selection.TypeText Text:=Text1
.Selection.MoveRight Unit:=wdCharacter, Count:=1
.Selection.TypeText Text:=Text2
.Selection.MoveLeft Unit:=wdCharacter, Count:=1
End Withmydocument.Save
mydocument.Close
Set mydocument = Nothing
myword.Quit
Set myword = Nothing
End SubPrivate Sub Command2_Click()
Unload Me
End SubPrivate Sub Command3_Click()
Form1.Show vbModal
End Sub再第二各窗体中应用ole插入word文档 ,别望了引用word 9.0
第二窗体输入
Private Sub Command1_Click()
Unload Me
End SubPrivate Sub Form_Load()
OLE1.CreateLink ("c:\temp.doc")OLE1.DoVerb
OLE1.Action = 7
OLE1.object.Application.Visible = False
End SubPrivate Sub Form_Unload(Cancel As Integer)
OLE1.object.Application.QuitEnd Sub
效果还是不理想,我想要的效果和http://www.dbstep.com的一样
WebBrowser1.Navigate "c:\1.doc" 即可