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文檔插入文檔對象 哈哈