这是我的代码。调试器指向第二个子,问题在哪里。我希望使用两个不同的pre_word将文档保存为pdf。
Sub yeniDosyaAdiVer()
yeniDosyaAdiKelimeleri = Split(ActiveDocument.FullName, ".")
yeniDosyaAdiKelimeleriSayisi = UBound(yeniDosyaAdiKelimeleri)
'MsgBox ("Kelime sayısı:" & yeniDosyaAdiKelimeleriSayisi)
For xcv = 0 To (yeniDosyaAdiKelimeleriSayisi - 1)
'MsgBox (xcv & ". kelime:" & yeniDosyaAdiKelimeleri(xcv))
sonDosyaAdi = sonDosyaAdi & yeniDosyaAdiKelimeleri(xcv) & "."
'MsgBox (sonDosyaAdi)
yeniDosyaAdiVer = sonDosyaAdi
End Sub
Sub TİTCK2pdf()
With ActiveDocument
.ExportAsFixedFormat OutputFileName:="titck-imza-" & yeniDosyaAdiVer() & "pdf", _
ExportFormat:=wdExportFormatPDF, OpenAfterExport:=False, _
OptimizeFor:=wdExportOptimizeForPrint, Range:=wdExportAllDocument, _
Item:=wdExportDocumentContent, IncludeDocProps:=True, KeepIRM:=True, _
CreateBookmarks:=wdExportCreateNoBookmarks, DocStructureTags:=True, _
BitmapMissingFonts:=True, UseISO19005_1:=False
End With
End Sub
Sub TİTCK_ic2pdf()
With ActiveDocument
.ExportAsFixedFormat OutputFileName:="titck-imza-ic-" & yeniDosyaAdiVer() & "pdf", _
ExportFormat:=wdExportFormatPDF, OpenAfterExport:=False, _
OptimizeFor:=wdExportOptimizeForPrint, Range:=wdExportAllDocument, _
Item:=wdExportDocumentContent, IncludeDocProps:=True, KeepIRM:=True, _
CreateBookmarks:=wdExportCreateNoBookmarks, DocStructureTags:=True, _
BitmapMissingFonts:=True, UseISO19005_1:=False
End With
End Sub
答案 0 :(得分:1)
yeniDosyaAdiVer()
是一个子。它不会返回任何内容...在TITCK的第二行中,您要插入值,因此您需要将Sub更改为Function
Function yeniDosyaAdiVer()
yeniDosyaAdiKelimeleri = Split(ActiveDocument.FullName, ".")
yeniDosyaAdiKelimeleriSayisi = UBound(yeniDosyaAdiKelimeleri)
'MsgBox ("Kelime sayısı:" & yeniDosyaAdiKelimeleriSayisi)
For xcv = 0 To (yeniDosyaAdiKelimeleriSayisi - 1)
'MsgBox (xcv & ". kelime:" & yeniDosyaAdiKelimeleri(xcv))
sonDosyaAdi = sonDosyaAdi & yeniDosyaAdiKelimeleri(xcv) & "."
'MsgBox (sonDosyaAdi)
yeniDosyaAdiVer = sonDosyaAdi
End Function
Sub TİTCK2pdf()
With ActiveDocument
.ExportAsFixedFormat OutputFileName:="titck-imza-" & yeniDosyaAdiVer & "pdf", _
ExportFormat:=wdExportFormatPDF, OpenAfterExport:=False, _
OptimizeFor:=wdExportOptimizeForPrint, Range:=wdExportAllDocument, _
Item:=wdExportDocumentContent, IncludeDocProps:=True, KeepIRM:=True, _
CreateBookmarks:=wdExportCreateNoBookmarks, DocStructureTags:=True, _
BitmapMissingFonts:=True, UseISO19005_1:=False
End With
End Sub
Sub TİTCK_ic2pdf()
With ActiveDocument
.ExportAsFixedFormat OutputFileName:="titck-imza-ic-" & yeniDosyaAdiVer & "pdf", _
ExportFormat:=wdExportFormatPDF, OpenAfterExport:=False, _
OptimizeFor:=wdExportOptimizeForPrint, Range:=wdExportAllDocument, _
Item:=wdExportDocumentContent, IncludeDocProps:=True, KeepIRM:=True, _
CreateBookmarks:=wdExportCreateNoBookmarks, DocStructureTags:=True, _
BitmapMissingFonts:=True, UseISO19005_1:=False
End With
End Sub