473,382 Members | 1,750 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

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\CommonDbs\EventSpend\Documentation\Meeting Authorization.doc"
strOutNme =
"\\Homa\CommonDbs\EventSpend\Documentation\Authori ze.doc"

Dim objWord As Word.Document
Set objWord = GetObject(strGetDoc, "Word.Document")
'Make Word visible.
objWord.Application.Visible = True
'Set the mail merge data source as the database containing the mail
merge data.
objWord.MailMerge.OpenDataSource _
Name:="\\Homa\CommonDbs\EventSpend\Apps\EventSpend XP.mdb", _
LinkToSource:=False, _
Connection:="Table tblAuthorizationData",
SQLStatement:="Select * from [tblAuthorizationData]"
'Execute the mail merge.
objWord.MailMerge.Destination = wdSendToNewDocument
objWord.SaveAs (strOutNme)
objWord.MailMerge.Execute
'close the Word application
objWord.Application.Quit
Set objWord = Nothing

thanks for any and all help
bobh.

Apr 19 '06 #1
0 1092

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

Similar topics

5
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...
2
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
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...
16
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...
9
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...
1
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...
2
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...
4
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...
3
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.