Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Adias
 
Posts: n/a
Default 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

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Word 97 in Windows XP to maintain formatting Charlie''s Word VBA questions Microsoft Word Help 22 May 20th 23 08:51 PM
Reveal codes in a word document FUN101 Microsoft Word Help 4 May 16th 23 08:47 PM
Why dont MS just f**king re-write Word from scratch? Its dogsh*t Word Hater Microsoft Word Help 33 May 5th 23 02:52 PM
How to put graphics on envelopes? Steve Koenig Microsoft Word Help 21 April 29th 23 02:47 AM
Does Word have a QuickCorrect/Quick Word option like WordPerfect? CW New Users 2 December 20th 05 05:54 PM


All times are GMT +1. The time now is 04:46 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"