A. VB怎么控制Word里面的图片
一直没人回答你,大概是觉得你问的太不认真了,你具体想要什么效果,单从你发的这几个字,你是不是想用vb做个程序代替你处理Word里面的图片?如果是这样那就几乎不能做到了,或者是我才疏学浅,帮不到你了
B. 用vb如何把word每一页转成图片
这个可以用数据流实现。可以先把word导入到数据流。把数据流转换成图片。
C. VB如何获得WORD表格中的图片
这个应该是做不到的,Word不像Excel和数据库,它的表格格式是不固定的
D. 如何在VB中建立word文档,并写入文字和图片
首先说明,你这样是写TXT,不是DOC,虽然Word可以打开,但根本就不是Word文件。当然不能存储图片了。请参考我以下的代码。建一个Command1。
================
Dim ap As Word.Application, doc As Document
Private Sub Form_Load() '这个过程不必做修改,是建立一个新的Word文档
Set ap = CreateObject("word.application")
ap.Visible = True
Set doc = ap.Documents.Add
End Sub
Private Sub Command1_Click()
doc.Content.InsertAfter Text:="请输入你要输入的内容" '插入文字,请使用这种格式
doc.Shapes.AddPicture FileName:="D:\a.jpg" '插入图片,请使用这种格式,路径自己写
End Sub
其他问题再找我。
E. vb在word中插入图片
先用宏录制一下操作,再看是如何做的。
F. VB 如何控制WORD中插入图片的大小等属性
自己录个宏,稍加改动就可以了。
Sub 图片旋转270度对齐页面()
'图片排版270度
If Selection.InlineShapes.Count = 0 Then
If Selection.ShapeRange.Count <> 0 Then
Selection.ShapeRange.Fill.Visible = msoFalse
'Selection.ShapeRange.AlternativeText = "Higer标书工具修改"
Selection.ShapeRange.Fill.Solid
Selection.ShapeRange.Fill.Transparency = 0#
Selection.ShapeRange.Line.Weight = 0.75
Selection.ShapeRange.Line.DashStyle = msoLineSolid
Selection.ShapeRange.Line.Style = msoLineSingle
Selection.ShapeRange.Line.Transparency = 0#
Selection.ShapeRange.Line.Visible = msoFalse
Selection.ShapeRange.LockAspectRatio = msoFalse
Selection.ShapeRange.Rotation = 270#
Selection.ShapeRange.Width = CentimetersToPoints(28.9)
Selection.ShapeRange.Height = CentimetersToPoints(20.2)
'Selection.ShapeRange.PictureFormat.Brightness = 0.5
'Selection.ShapeRange.PictureFormat.Contrast = 0.5
'Selection.ShapeRange.PictureFormat.ColorType = msoPictureAutomatic
Selection.ShapeRange.PictureFormat.CropLeft = 0#
Selection.ShapeRange.PictureFormat.CropRight = 0#
Selection.ShapeRange.PictureFormat.CropTop = 0#
Selection.ShapeRange.PictureFormat.CropBottom = 0#
'Selection.ShapeRange.Left = 90.1
'Selection.ShapeRange.Top = 88.15
'Selection.ShapeRange.Left = -120.45
'Selection.ShapeRange.Top = 109.1
Selection.ShapeRange.RelativeHorizontalPosition = _
Selection.ShapeRange.RelativeVerticalPosition = _
Selection.ShapeRange.Left = wdShapeCenter
Selection.ShapeRange.Top = wdShapeCenter
Selection.ShapeRange.LockAnchor = False
Selection.ShapeRange.LayoutInCell = True
Selection.ShapeRange.WrapFormat.AllowOverlap = True
Selection.ShapeRange.WrapFormat.Side = wdWrapBoth
Selection.ShapeRange.WrapFormat.DistanceTop = CentimetersToPoints(0)
Selection.ShapeRange.WrapFormat.DistanceBottom = CentimetersToPoints(0)
Selection.ShapeRange.WrapFormat.DistanceLeft = CentimetersToPoints(0.32)
Selection.ShapeRange.WrapFormat.DistanceRight = CentimetersToPoints(0.32)
Selection.ShapeRange.WrapFormat.Type = 3
Selection.ShapeRange.ZOrder 4
Selection.ShapeRange.ZOrder msoSendBackward
End If
End If
If Selection <> "" Then
If Selection.InlineShapes.Count <> 0 Then
'Selection.InlineShapes(1).Fill.Visible = msoFalse
'Selection.InlineShapes(1).Fill.Solid
'Selection.InlineShapes(1).Fill.Transparency = 0#
'Selection.InlineShapes(1).Line.Weight = 0.75
'Selection.InlineShapes(1).Line.Transparency = 0#
'Selection.InlineShapes(1).Line.Visible = msoFalse
'Selection.InlineShapes(1).LockAspectRatio = msoFalse
'Selection.InlineShapes(1).Width = CentimetersToPoints(28.9)
'Selection.InlineShapes(1).Height = CentimetersToPoints(20.2)
'Selection.InlineShapes(1).PictureFormat.Brightness = 0.5
'Selection.InlineShapes(1).PictureFormat.Contrast = 0.5
'Selection.InlineShapes(1).PictureFormat.ColorType = msoPictureAutomatic
'Selection.InlineShapes(1).PictureFormat.CropLeft = 0#
'Selection.InlineShapes(1).PictureFormat.CropRight = 0#
'Selection.InlineShapes(1).PictureFormat.CropTop = 0#
'Selection.InlineShapes(1).PictureFormat.CropBottom = 0#
Selection.InlineShapes(1).ConvertToShape '属性转换(InlineShapes(1)转换为ShapeRange)
Selection.ShapeRange.Fill.Visible = msoFalse
'Selection.ShapeRange.AlternativeText = "Higer标书工具修改"
Selection.ShapeRange.Fill.Solid
Selection.ShapeRange.Fill.Transparency = 0#
Selection.ShapeRange.Line.Weight = 0.75
Selection.ShapeRange.Line.DashStyle = msoLineSolid
Selection.ShapeRange.Line.Style = msoLineSingle
Selection.ShapeRange.Line.Transparency = 0#
Selection.ShapeRange.Line.Visible = msoFalse
Selection.ShapeRange.LockAspectRatio = msoFalse
Selection.ShapeRange.Width = CentimetersToPoints(28.9)
Selection.ShapeRange.Height = CentimetersToPoints(20.2)
Selection.ShapeRange.Rotation = 270#
'Selection.ShapeRange.PictureFormat.Brightness = 0.5
'Selection.ShapeRange.PictureFormat.Contrast = 0.5
'Selection.ShapeRange.PictureFormat.ColorType = msoPictureAutomatic
Selection.ShapeRange.PictureFormat.CropLeft = 0#
Selection.ShapeRange.PictureFormat.CropRight = 0#
Selection.ShapeRange.PictureFormat.CropTop = 0#
Selection.ShapeRange.PictureFormat.CropBottom = 0#
Selection.ShapeRange.RelativeHorizontalPosition = _
Selection.ShapeRange.RelativeVerticalPosition = _
Selection.ShapeRange.Left = wdShapeCenter
Selection.ShapeRange.Top = wdShapeCenter
Selection.ShapeRange.LockAnchor = False
Selection.ShapeRange.LayoutInCell = True
Selection.ShapeRange.WrapFormat.AllowOverlap = True
Selection.ShapeRange.WrapFormat.Side = wdWrapBoth
Selection.ShapeRange.WrapFormat.DistanceTop = CentimetersToPoints(0)
Selection.ShapeRange.WrapFormat.DistanceBottom = CentimetersToPoints(0)
Selection.ShapeRange.WrapFormat.DistanceLeft = CentimetersToPoints(0.32)
Selection.ShapeRange.WrapFormat.DistanceRight = CentimetersToPoints(0.32)
Selection.ShapeRange.WrapFormat.Type = 3
Selection.ShapeRange.ZOrder 4
Selection.ShapeRange.ZOrder msoSendBackward
End If
End If
End Sub
G. vb中如何在word文档中插入图形文件
Dim MyWord As Object
Dim NewDoc As Object
Set MyWord = CreateObject("Word.Application") '创建一个word对象
M = App.Path & "\123.doc"
Set NewDoc = MyWord.Documents.Open(M)
Clipboard.Clear '清除剪贴板
Clipboard.SetData Picture1.Picture 'vbCFBitmap 图片框中图片装入剪贴板
MyWord.Selection.TypeText "123" & "." & vbCr '换行
MyWord.Selection.Paste '将剪贴板中的图像复制到Word文档中
MyWord.Selection.TypeText (vbCrLf) '换行
NewDoc.Content.InsertAfter "123" & "." & vbCr
Set NewDoc = Nothing
Set MyWord = Nothing '清除对象
H. vb 在WORD里插入一张图片
图片设置为“四周型”
I. 怎样用VB打开word文件,并插入一个图片到该word文件
迟了一步,但不过还是贴点东西过来,要不然刚才花那么多时间白研究了
先在工程引用microsoft word
Option Explicit
Dim WithEvents WordApp As Word.Application
Dim WithEvents WordDoc As Word.Document
Private Sub Command1_Click()
Set WordApp = New Word.Application
WordApp.Visible = True
WordApp.Documents.Add
WordApp.ActiveDocument.Shapes.AddPicture "C:\WINNT\CIBA1B.bmp"
如果要保存成你定下的名字就用WordApp.ActiveDocument.Saveas……
J. vb 求word的读写(文字和图片)代码
这个要通过VBA借口操作,你查找下VBA,相信对你有帮助
VB 读并显示 如果不是直接打开,或引用VB文档, 可以采取操作VBA接口 保存成网页用 webbrowser控件显示
至于VB 写,那么只好根据VBA 语法,格式慢慢编写了,很难说清,重要的是我也没做过,哈哈,但是通过VBA皆苦还是不会错的
当然你可以直接点 VB的菜单-工程-部件--可插入对象--word文档插入文档对象 哈哈