用vb在word文档中插入和导出图片对象资料
2、在Word文档中插入和导出图片对象[vb] HYPERLINK "http://blog.csdn.net/chenjl1031/article/details/8905354" \o "vie
2Word 、在文档中插入和导出图片对象 [vb] viewplaincopy 1. 'MicrosoftWord11.0ObjectLibrary 先引用 2. OptionExplicit 3. 4. DimWordAppAsWord.Application'Word 创建应用程序 5. 6. PrivateSubCommand1_Click() 7. OnErrorGoToErrhandler 8. CommonDialog1.Filter="Word(*.Doc)|*.Doc|AllFile(*.*)|*.*" 9. CommonDialog1.FilterIndex=1 10. CommonDialog1.ShowOpen 11. SetWordApp=NewWord.Application' 实例化 12. WordApp.Documents.OpenCommonDialog1.FileName'Word 打开文件 13. WordApp.Visible=True'OfficeWord 显示界面 14. 'Application.Visible=True 或者 15. WordApp.DisplayAlerts=False' 不提示保存对话框 16. WordApp.Selection.EndKeyUnit:=wdStory' 将光标移到文档末尾,在文本后面插入图片对象 17. Selection.TypeTextText:=""' 我的图片图片的标题名称 18. 19. ' 插入图片对象 20. Selection.InlineShapes.AddPictureFileName:="C:\CommandPicture.jpg",LinkToFile:=False, SaveWithDocument:=True 21. Selection.MoveLeftUnit:=wdCharacter,Count:=1,Extend:=wdExtend 22. Selection.InlineShapes(1).ConvertToShape.Select 23. Selection.ShapeRange.Fill.Visible=msoFalse 24. Selection.ShapeRange.Fill.Transparency=0# 25. Selection.ShapeRange.Line.Weight=0.75 26. Selection.ShapeRange.Line.DashStyle=msoLineSolid 27. Selection.ShapeRange.Line.Style=msoLineSingle 28. Selection.ShapeRange.Line.Transparency=0# 29. Selection.ShapeRange.Line.Visible=msoFalse 30. Selection.ShapeRange.LockAspectRatio=msoTrue 31. Selection.ShapeRange.Height=361.4 32. Selection.ShapeRange.Width=481.6 33. Selection.ShapeRange.PictureFormat.Brightness=0.5 34. Selection.ShapeRange.PictureFormat.Contrast=0.5 35. Selection.ShapeRange.PictureFormat.ColorType=msoPictureAutomatic 36. Selection.ShapeRange.PictureFormat.CropLeft=0# 37. Selection.ShapeRange.PictureFormat.CropRight=0# 38. Selection.ShapeRange.PictureFormat.CropTop=0# 39. Selection.ShapeRange.PictureFormat.CropBottom=0# 40. Selection.ShapeRange.RelativeHorizontalPosition=wdRelativeHorizontalPositionColumn 41. Selection.ShapeRange.RelativeVerticalPosition=wdRelativeVerticalPositionPage

