Solved

Problem doing a Mail Merge with Word 97 in Windows 95

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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
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…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

707 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now