473,327 Members | 2,090 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,327 software developers and data experts.

Problem launching "directory" type mail merge documents from Access

I have set up a Word mail merge document of the type Directory which
allows me to display all of the records on a single page rather than
putting each record on a separate page. It uses a temporary table in
MS Access as its datasource (loaded via a Make Table query). If I
create the temporary table and then open the mail merge document from
within MS Word and click "Merge to New Document", the information from
the temporary table is displayed in the table that I have set up. The
table looks normal with all rows on the same page.

If I use VBA to launch Word and open the same document, the data
appears but there is a section break between each row of the table. If
I want the table all together on the page, I have to manually delete
all of the section breaks. Can anybody tell me why the section breaks
are being inserted when they are clearly not in the original document?

The code that I am using is pretty standard. I am passing strTableName
as a parameter to the procedure.

Dim wrkDefault As Workspace
Dim WordDoc As Object
Dim WordApp As Object
Dim db As Database

Set db = CurrentDb

Set wrkDefault = DBEngine.Workspaces(0)

' open up word with the Mail Merge document, using the path that we
found
' with the File Open dialogue box above.
Set WordApp = CreateObject("word.application")
Set WordDoc = WordApp.Documents.Open(strInputFileName)
WordDoc.Application.Visible = True
WordDoc.MailMerge.OpenDataSource Name:=db.Name, LinkToSource:=True,
Connection:="TABLE " & strTableName, SQLStatement:="SELECT * FROM [" &
strTableName & "]"
Set db = Nothing

Thanks for any help you may have,
Sheila

May 4 '06 #1
0 1627

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

Similar topics

2
by: francescomoi | last post by:
Hi. I'm trying to build 'MySQL-python-1.2.0' on my Linux FC2: ---------------------------------- # export PATH=$PATH:/usr/local/mysql/bin/ # export mysqlclient=mysqlclient_r # python setup.py...
4
by: Ed | last post by:
Hello All, I posted earlier about a problem I was having with editing or pasting/deleting files in the "Home Directory" of my web server. I just noticed that the "Home Directory" option in the...
4
by: hamacher | last post by:
I have a particular need to an application . . . I need users to specify a directory (with path) on their filesystem on an HTML page. All I need at the server is a string representation of the...
4
by: davidw | last post by:
For example, I have a virtual directory - "wfile", I would like user access http://mysite/wfile, but I want to handle it with my own code instead of turn on "Directory Browsing", how can I capture...
7
by: Alex Maghen | last post by:
Hi. I had previously installed VS2005 beta 1. I carefully followed all the steps (I thought) to deinstall it and then installed beta 2. According to the documentation, the "Data" directory which...
1
by: Dave | last post by:
I am getting te following error in a ASP.Net app that is running on Win XP Pro (SP2): Server cannot access application directory 'C:\Documents and Settings\dave\My Documents\My Visual Studio...
1
by: webonomic | last post by:
A number of topics ask how to solve the "Cannot use a leading .. to exit above the top directory" error. I am having the same problem with an asp.net 2.0 website. The site works fine on...
21
by: comp.lang.tcl | last post by:
set php {<? print_r("Hello World"); ?>} puts $php; # PRINTS OUT <? print_r("Hello World"); ?> puts When I try this within TCL I get the following error:
18
by: metaphysics | last post by:
I'm having trouble with installing something that requires me running a script using a command prompt. The instructions say that I need to open a command prompt to my /script/script_name/ directory...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.