|
楼主 |
发表于 2014-4-26 23:45
|
显示全部楼层
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
不知道还需要怎样优化才能转成PDF之后直接就不能复制文字- Sub word2picture()
- Dim i%, j%
- Dim aDoc As Document: Set aDoc = ActiveDocument
- Dim aName$: aName = aDoc.Name
- Dim wdApp As Word.Application: Set wdApp = GetObject(, "Word.Application") '获取已打开的Word程序
- wdApp.Documents(aName).Windows(1).Visible = False
- j = aDoc.Content.Information(wdActiveEndPageNumber)
- For i = 1 To j
- Selection.GoTo wdGoToPage, wdGoToAbsolute, i
- Selection.Bookmarks("\page").Range.CopyAsPicture
- Selection.PasteSpecial Placement:=wdInLine, DataType:=wdPasteEnhancedMetafile '在域代码区域粘贴图元文件
- Next
- wdApp.Documents(aName).Windows(1).Visible = True
- End Sub
复制代码 |
|