473,811 Members | 2,963 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Trouble with Access97 and Word

Hi All,
I'm trying to get this(see below) to work but have not been successful
so far, what I'm trying to get done is;

open a word document which is already setup as a mailmerge document
merge the one record from the table to the document
save the fillin documment with a diff name
close the mailmerge document
close word

can someone fix my vba code

Dim strGetDoc As String, strOutNme As String
strGetDoc =
"\\Homa\CommonD bs\EventSpend\D ocumentation\Me etingAuthorizat ion.doc"
strOutNme =
"\\Homa\CommonD bs\EventSpend\D ocumentation\Au thorize.doc"

Dim objWord As Word.Document
Set objWord = GetObject(strGe tDoc, "Word.Document" )
'Make Word visible.
objWord.Applica tion.Visible = True
'Set the mail merge data source as the database containing the mail
merge data.
objWord.MailMer ge.OpenDataSour ce _
Name:="\\Homa\C ommonDbs\EventS pend\Apps\Event SpendXP.mdb", _
LinkToSource:=F alse, _
Connection:="Ta ble tblAuthorizatio nData",
SQLStatement:=" Select * from [tblAuthorizatio nData]"
'Execute the mail merge.
objWord.MailMer ge.Destination = wdSendToNewDocu ment
objWord.SaveAs (strOutNme)
objWord.MailMer ge.Execute
'close the Word application
objWord.Applica tion.Quit
Set objWord = Nothing

thanks for any and all help
bobh.

Apr 19 '06 #1
0 1104

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
4068
by: Chris Dugan | last post by:
Hi, has anybody come across a solution to running an Access97 database on Windows XP. The situation I have is an Access 97 database that runs perfectly from Win95/98 clients running Access97, the database sits on a Windows2000 server to which everyone has full NTFS access rights. The problem is the WinXP and Win2k clients which appear to run fine (also running Access97) in reading any existing data but as soon as you attempt to edit a...
2
2632
by: G Moore | last post by:
I am trying to print out a table in the design mode... any ideas/help? Gordon Moore paragon_st@yahoo.com
1
2654
by: Mario Crevits | last post by:
My name is Mario Crevits, I'm from Belgium (Roeselare) and I'm working with Access97 for several years now. We are in an Access97-2000 migration project. I'm writing a wizard for the end-users to automatically find and convert their Access97 databases on a specific drive. I want to convert the databases through VBA : 1. create an empty Access2000 2. set the right properties and references 3. import the objects (tables, queries,...
16
2550
by: David W. Fenton | last post by:
I have an app for a client (Access97, all the final service releases and Jet service packs, full installation (not runtime)), that displays a graphic in an image control based on a path/filename stored in a field in a data table. It works just great on my PC for BMP, GIF and JPG. But on the client's PC, JPG doesn't work (dunno if GIF works or not -- didn't try it; BMP does work). I wrote to Larry about this and he hasn't any...
9
5249
by: John | last post by:
Tried this on microsoft.public.access.gettingstarted - no response - perhaps more appropriate here. I'm not a database user, simply helping someone get started with a new computer. The old computer (win98se) runs a database in MS Access 97 pro, with all the attendant permissions etc. I can work on the database without problems, once I've opened the file with the requisite user name and
1
1846
by: IamKJVonly | last post by:
I have office 97 which includes access97 and have built many access97 databases and use VB4 as the front end. I have just gotten a new computer which has 1 gig of memory on it and when I try to install office 97 on it. everything installs ok execpt access97 won't run. I have since tried it on another machine and it seems to be a memory problem. If the computer's memory is more than 512megs. then access97 won't run. Is there a patch or...
2
2546
by: spidey12345 | last post by:
what i need this program to do is to read paragraphs like "st blah blh test ere se sit blha eere w" and then it will reformat to "st blah blh test ere se sit blha eere w" ....
4
11572
by: Rico | last post by:
Hello, I have an MDE application where I use a bound object frame to display an image. This frame is updatable and bested on the contents of an OLE field. My problem is, some images display as the image and some display as an icon with the file name below. The process I'm following is as follows; Right click Choose "Insert Object..." Select "Create from File"
3
1965
by: Ramchandar | last post by:
Hi, I am creating reports using VBA code. I have the same query in a querydef residing both in Access97 and Access2003. The result of this querydef is then moved to a table in Access97 and Access2003 respectively. The table in Access97 returns 874 rowcount, table in Access 2003 returns 1050 rowcount. In both the case the querydef is retrieving from the same database which resides in SQL Server 2003. I executed the application Access97 and...
0
9734
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9607
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10401
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9217
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7676
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6897
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5567
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5704
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4357
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.