新之助meow

Kratos
专注于用户阅读体验的响应式博客主题
  1. 首页
  2. 未分类
  3. 正文

excel vba 将word存为pdf格式,插入图片,设置透明度

2017年10月7日 580点热度 0人点赞 0条评论

word不支持对插入图片设置透明度,但可以插入一个绘图区域,文本框或者方形,然后设置底纹选择图片,然后对这个框来设置透明度

转换pdf文件

Sub mac()
' 
    ActiveDocument.ExportAsFixedFormat OutputFileName:="D:\Doc1.pdf", _
        ExportFormat:=wdExportFormatPDF, OpenAfterExport:=False, OptimizeFor:= _
        wdExportOptimizeForPrint, Range:=wdExportAllDocument, From:=1, To:=1, _
        Item:=wdExportDocumentContent, IncludeDocProps:=True, KeepIRM:=True, _
        CreateBookmarks:=wdExportCreateNoBookmarks, DocStructureTags:=True, _
        BitmapMissingFonts:=True, UseISO19005_1:=False
End Sub
Sub gopdf()

  Application.DisplayAlerts = False
  Application.ScreenUpdating = False
Dim fDialog As FileDialog
  Set fDialog = Application.FileDialog(msoFileDialogFilePicker) '返回一个 FileDialog 对象,该对象代表文件对话框的单个实例。
Dim vrtSelectedItem As Variant
Dim wdDoc As Document
Dim showFolder As Boolean
  showFolder = False
  With fDialog
    .Filters.Add "Word文件", "*.doc;*.docx;*.docm", 1
    If .Show = -1 Then
      For Each vrtSelectedItem In .SelectedItems
        '如果选择了本文档则跳过
        If InStrRev(vrtSelectedItem, ThisDocument.Name) = 0 Then
          On Error Resume Next
          Set wdDoc = Application.Documents.Open(vrtSelectedItem, ReadOnly:=True)
          wdDoc.SaveAs Left(vrtSelectedItem, Len(vrtSelectedItem) - 5), wdFormatPDF
          wdDoc.Close False
        End If
      Next vrtSelectedItem
      If showFolder Then Call Shell("explorer.exe " & Left(fDialog.SelectedItems(1), _
         InStrRev(fDialog.SelectedItems(1), "")), vbMaximizedFocus)
    End If
  End With
  Set fDialog = Nothing
  Application.ScreenUpdating = True

  Application.DisplayAlerts = True

End Sub
标签: 暂无
最后更新:2017年10月7日

tjccn_wx@hotmail.com

这个人很懒,什么都没留下

点赞
< 上一篇
下一篇 >

文章评论

razz evil exclaim smile redface biggrin eek confused idea lol mad twisted rolleyes wink cool arrow neutral cry mrgreen drooling persevering
取消回复

归档

  • 2026 年 10 月
  • 2024 年 2 月
  • 2023 年 7 月
  • 2023 年 1 月
  • 2022 年 10 月
  • 2022 年 9 月
  • 2022 年 6 月
  • 2022 年 4 月
  • 2022 年 3 月
  • 2022 年 2 月
  • 2021 年 11 月
  • 2021 年 10 月
  • 2021 年 9 月
  • 2021 年 1 月
  • 2020 年 12 月
  • 2020 年 11 月
  • 2020 年 10 月
  • 2020 年 9 月
  • 2020 年 7 月
  • 2020 年 6 月
  • 2020 年 5 月
  • 2020 年 4 月
  • 2020 年 3 月
  • 2020 年 2 月
  • 2019 年 10 月
  • 2019 年 8 月
  • 2019 年 7 月
  • 2019 年 4 月
  • 2019 年 3 月
  • 2018 年 12 月
  • 2018 年 11 月
  • 2018 年 10 月
  • 2018 年 6 月
  • 2018 年 5 月
  • 2018 年 4 月
  • 2018 年 3 月
  • 2018 年 2 月
  • 2018 年 1 月
  • 2017 年 12 月
  • 2017 年 11 月
  • 2017 年 10 月
  • 2017 年 9 月
  • 2017 年 8 月
  • 2017 年 7 月
  • 2017 年 6 月
  • 2017 年 5 月
  • 2017 年 4 月
  • 2017 年 3 月
  • 2017 年 2 月
  • 2017 年 1 月
  • 2016 年 12 月
  • 2016 年 11 月
  • 2016 年 10 月
  • 2016 年 9 月
  • 2016 年 8 月
  • 2016 年 7 月
  • 2016 年 6 月
  • 2016 年 5 月
  • 2016 年 4 月
  • 2016 年 3 月
  • 2015 年 12 月
  • 2015 年 8 月

分类

  • android
  • mysql
  • nethunter
  • proxmark
  • 未分类

COPYRIGHT © 2026 新之助meow. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang