문제

I have created an Excel to Word mailmerge and the Word document is my Merge Template.

When i use the current path codes, e.g. CurDir(), ActiveDocument.Path,ThisDocument.FullName etc. etc. it gives me:

C:\users\rgillooly\AppData\Roaming\Microsoft\Templates Which is where the Normal.dotm file sits.

Is there any code that will pick up the "Files" actual location and not where its pointing to ? E.g. C:\users\rgillooly\desktop\MailMerge

Cheers

도움이 되었습니까?

해결책

I saved my document master.docm (Word Document with Macros): It gives the directory of the good current document:

CurDir() => C:\users\rgillooly\desktop\MailMerge
ActiveDocument.Path => C:\users\rgillooly\desktop\MailMerge
ThisDocument.FullName => C:\users\rgillooly\desktop\MailMerge\master.docm

If saved as master.dotm (Word Template), it gives config directory:

CurDir() => C:\users\rgillooly\AppData\Roaming\Microsoft\Templates
ActiveDocument.Path =>
ThisDocument.FullName => C:\users\rgillooly\AppData\Roaming\Microsoft\Templates\master.dotm
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top