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
Solved

Problem doing a Mail Merge with Word 97 in Windows 95

Posted on 2000-04-06
4
157 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
  • 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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

840 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