为什么 SaveAs 在宏中不使用正确的 PixelsPerInch? [英] Why doesn't SaveAs use correct PixelsPerInch in macro?
问题描述
我有一个将 Word 文档转换为 htm 的宏.问题是图像总是保存为 96 ppi,即使我指定了 240 ppi.
I have a macro which converts Word docs to htm. The problem is that the images are always saved as 96 ppi, even though I have specified 240 ppi.
关于如何修复的任何想法?
Any ideas on how to fix?
这是我的宏:
Sub Doc2htm()
With ActiveDocument.WebOptions
.RelyOnCSS = True
.OptimizeForBrowser = False
.OrganizeInFolder = True
.UseLongFileNames = True
.RelyOnVML = False
.AllowPNG = True
.ScreenSize = msoScreenSize800x600
.PixelsPerInch = 240
.Encoding = msoEncodingWestern
End With
With Application.DefaultWebOptions
.UpdateLinksOnSave = True
.CheckIfOfficeIsHTMLEditor = False
.CheckIfWordIsDefaultHTMLEditor = False
.AlwaysSaveInDefaultEncoding = False
.SaveNewWebPagesAsWebArchives = True
End With
Dim newName As String
Dim fileDir As String
newName = ActiveDocument.Name
If InStr(newName, ".doc") = 0 Then Exit Sub
newName = Left(newName, InStr(newName, ".doc") - 1) & ".htm"
fileDir = Left(ActiveDocument.FullName, InStrRev(ActiveDocument.FullName, "\"))
ChangeFileOpenDirectory fileDir
ActiveDocument.SaveAs FileName:=fileDir & newName, FileFormat:= _
wdFormatFilteredHTML, LockComments:=False, Password:="", AddToRecentFiles _
:=True, WritePassword:="", ReadOnlyRecommended:=False, EmbedTrueTypeFonts _
:=False, SaveNativePictureFormat:=False, SaveFormsData:=False, _
SaveAsAOCELetter:=False
'Application.Quit
End Sub
推荐答案
Try FileFormat:=wdFormatHTML 而不是 FileFormat:= wdFormatFilteredHTML
Try FileFormat:=wdFormatHTML rather than of FileFormat:= wdFormatFilteredHTML
来自 http://answers.microsoft.com/en-us/office/forum/office_2010-word/image-quality-changes-when- Saving-as-web-page/4c860944-c627-4fed-afd4-a7473ab1dee6另存为已过滤"HTML 将删除任何 Office 特定标签并对文件进行更改以帮助确保浏览器兼容性.除了剥离标签,另存为已过滤 HTML 还将图像缩小到屏幕分辨率."
From http://answers.microsoft.com/en-us/office/forum/office_2010-word/image-quality-changes-when-saving-as-web-page/4c860944-c627-4fed-afd4-a7473ab1dee6 "Saving as "Filtered’ HTML will remove any Office specific tags and make changes to the file to help insure browser compatibility. Beyond stripping tags, saving as Filtered HTML also will reduce images to screen resolution."
来自网页,已过滤"中的图像质量"... 这是过滤网页保存在 Word 中的默认设置.所有 mso 标签都被删除,并通过将 DPI 降低到 96 使其尽可能小"
From Image quality in "Web Page, Filtered" "... this is by-default for Filtered webpage saves in Word. All mso tags are removed and it's made as small as possible by lowering the DPI to 96"
这篇关于为什么 SaveAs 在宏中不使用正确的 PixelsPerInch?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!