If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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? |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to put graphics on envelopes? | Steve Koenig | General Discussion | 20 | September 14th, 2007 04:40 PM |
Converting WordPerfect 12 files to Word 2003 | Curious | New Users | 3 | March 29th, 2006 01:05 AM |
How can Word display full path of a file in the title bar? | SAsif | General Discussion | 1 | January 26th, 2006 04:32 PM |
Word 97 in Windows XP to maintain formatting | Charlie''s Word VBA questions | General Discussion | 21 | October 24th, 2005 09:49 PM |
How to change merge forms from Word Perfect to Microsoft Word | Charles Kenyon | General Discussion | 1 | December 30th, 2004 03:35 PM |