【发布时间】:2020-03-31 05:24:58
【问题描述】:
我有一个 word 宏,它将文档保存为 pdf 并通过电子邮件发送。唯一的问题是它会在网络驱动器上覆盖自己。我不知道如何使用下面的代码将秒数转换为文件名。
感谢您的帮助!
dte = Date
savedName = "Night Orders - " & Format(dte, "yyyy-mm-dd")
Response = MsgBox("Save and email the current document?", vbOKCancel, "Are you sure?")
If Response = vbOK Then
savePath = saveDir & saveName & ".pdf"
ActiveDocument.ExportAsFixedFormat OutputFileName:=savePath, _
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
【问题讨论】:
-
你看过VBA函数
Time吗?