請問合併列印來源可以設相對路徑嗎?
想請問一下合併列印指定來源,都是絕對路徑
如果換資料夾或來源檔放到別的槽,就找不到了
有辦法設定相對路徑嗎?
例如我有一個資料夾,裡面放個ACCESS檔
其他WORD檔的來源都是該ACCESS檔
不論我把這個資料夾搬去C槽或D槽
仍然可以使用
若無法設定相對路徑,有其他替代方案能達成嗎?
謝謝 [b]回復 [url=http://forum.twbts.com/redirect.php?goto=findpost&pid=83064&ptid=15360]1#[/url] [i]iceandy6150[/i] [/b]
應該無法設定成相對路徑,只能重新設定新路徑
可參考~[url=https://support.microsoft.com/zh-tw/kb/275934]https://support.microsoft.com/zh-tw/kb/275934[/url] [b]回復 [url=http://forum.twbts.com/redirect.php?goto=findpost&pid=83064&ptid=15360]1#[/url] [i]iceandy6150[/i] [/b]
早期版本是相對路徑,Office 2007以後是絕對路徑。
為避免麻煩,可在完成編輯Word主文件後,將其還原為標準的Word文件,然後在ThisDocument中加入以下代碼:
Private Sub Document_Open()
On Error Resume Next
With ThisDocument.MailMerge
.MainDocumentType = wdCatalog '主文件型式設為型錄(目錄),也可設為信封wdEnvelopes、信件wdFormLetters或標籤wdMailingLabels。
.OpenDataSource Name:=ThisDocument.Path & "\○○○○○.xls" '「○○○○○.xls」改成資料來源檔名。假設來源檔在同一資料夾中。
'.Destination = wdSendToNewDocument
'.SuppressBlankLines = True
'With .DataSource
'.FirstRecord = wdDefaultFirstRecord
'.LastRecord = wdDefaultLastRecord
'End With
'.Execute True
End With
'ThisDocument.Close wdDoNotSaveChanges
End Sub
頁:
[1]