Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
using Word 2000 for mailmerge in VB
Hi,
I am running into a problem trying to do a mailmerge after I upgraded from Office 97 to Office 2000. The application is attempting to do a mailmerge using a Word document as a template with the merge fields, and this document is located in a network folder. I get an error: "Bad file name. Error: 4160." When I move the template to the local drive, it works fine. I tried giving Full rights to the network folder, and it still didn't help. I also tried giving the user local admin permissions to the PC, and I still get that error. I haven't changed the mailmerge code. The error occurs on the following line of code: m_WordApp.Documents.Item(sTempStr).MailMerge.OpenD ataSource sDataSource m_WordApp is defined as Word.Application sTempStr is a string with the UNC network path and template file name (\\network\Letters\Template.Doc) sDataSource is a string with the path and data file name(C:\projects\Lic60\DATA.Doc) Here is all the code: Set m_WordApp = New Word.Application m_WordApp.Documents.Open "\\network\Letters\Template.Doc" m_WordApp.Documents.Item(sTempStr).MailMerge.OpenD ataSource sDataSource If you notice the code above, the Open method did run successfully, which opens the template from the network folder. Why is it having trouble with the mailmerge.opendatasource method when the template is located on the network? |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Word 97 in Windows XP to maintain formatting | Microsoft Word Help | |||
Reveal codes in a word document | Microsoft Word Help | |||
Why dont MS just f**king re-write Word from scratch? Its dogsh*t | Microsoft Word Help | |||
How to put graphics on envelopes? | Microsoft Word Help | |||
Does Word have a QuickCorrect/Quick Word option like WordPerfect? | New Users |