Solved

Problem doing a Mail Merge with Word 97 in Windows 95

Posted on 2000-04-06
4
163 Views
Last Modified: 2010-05-02
I'm writing an application that does a mail merge on the fly.  I pass the recordset to already existing document and then it merges. I'm runing Windows 98 and Word 2000 and it's working great, but I installed this software on Windows 95 and Word 97 and it doesn't want to open Word 97 or do any kind of operations. Can anybody help with this problem, it's very urgent.  I appreciate your help and thanks for your time.
Russ
0
Comment
Question by:odessamama
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 

Author Comment

by:odessamama
ID: 2690226
I appreciate anybody's help.  Thanks for your time.
Russ
0
 
LVL 32

Accepted Solution

by:
bhess1 earned 100 total points
ID: 2690415
Odds are you are referencing the Word library in your Project/References, correct?  You will need to change that - you need to use CreateObject to reference whichever version of Word the user has:

Dim wdApp as Object
Set wdApp = CreateObject("Word.Application")

Instead of:

Dim wdApp as Word.Application
Set wdApp = New Word.Application

This allows the OS to retrieve the current version of Word on the PC, instead of tying your code to one version library.
0
 

Author Comment

by:odessamama
ID: 2690610
Thank you bhess1.  It works almost correctly now.  It brings up Word 97 and merges correctly, but I have to select the data source 2 after I already select it in my application.  After I select multiple times then it merges.  On Windows 98 with Word 2000 I only select the data source once in my app and then it merges.  If you have any ideas on how to get rid of that problem, please let me know.  Thank you very much for your time.
Russ
0
 
LVL 32

Expert Comment

by:bhess1
ID: 2690635
Can you show me the appropriate code?

BTW, you can check the app version in your code, and conditionally execute the 're-select' if the version of Word is Word97:

If Val(wrdApp.Version) < 9   ' check version # for Word2000 - I think it's 9
0

Featured Post

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question