怎样通过VB程序把图片插入到用OPEN打开的WORD文件中?

2024-12-26 05:24:12
推荐回答(1个)
回答1:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim MyFileName As String = "xtreme.bmp"
Dim MyImage As Image = Image.FromFile(MyFileName)
Dim MyLeft As Object = 10
Dim MyTop As Object = 50
Dim MyWidth As Object = MyImage.Width
Dim MyHeight As Object = MyImage.Height
Me.Shapes.AddPicture(MyFileName, System.Reflection.Missing.Value, _
System.Reflection.Missing.Value, MyLeft, MyTop, MyWidth, _
MyHeight, System.Reflection.Missing.Value)
End Sub