花了点时间帮你写了下,你自己测试一下.
Using f As New OpenFileDialog
f.Filter = "*.jpg|*.jpg"
If f.ShowDialog <> Windows.Forms.DialogResult.OK Then Return
Using fs As New IO.FileStream(f.FileName, IO.FileMode.Open, IO.FileAccess.Read)
Dim img = Image.FromStream(fs)
If img.Size.Height <> 768 OrElse img.Size.Width = 1024 Then
Using bmp As New Bitmap(1024 * 768)
Using g = Graphics.FromImage(bmp)
g.DrawImage(img, New Rectangle(0, 0, 1024, 768))
img = bmp
End Using
Clipboard.Clear()
Clipboard.SetImage(img)
End Using
End If
End Using
End Using
Dim path As String = "c:\abcd.doc"
Dim wd As New Microsoft.Office.Interop.Word.Application
Dim doc As Microsoft.Office.Interop.Word.Document = wd.Documents.Open(FileName:=path)
doc.Activate()
wd.Selection.EndKey(Unit:=Microsoft.Office.Interop.Word.WdUnits.wdStory)
wd.Selection.TypeParagraph()
wd.Selection.Paste()
doc.Save()
doc.Close()
wd.Quit()