Similar Threads:
1.Mailmerge data source in an Access database will not open
I am creating directory in Word 2003 by mailmerge using as the data source a
query in an Access database (prepared in Access 2003 but in 2000 format) .
When I attempt to browse to the data source I find that every table and query
is listed except the one I want.
Approaching the problem via Tools > Office Links etc in Access, the required
query is listed but draws the response " Can not open data source".
The only exceptional feature of the query i can see is that it contains a
number of calculated fields.
2."Word was unable to open the Excel data source" Asp.net Mailmerge
Hi,
I am trying to perform word mail merge operation via ASP.Net using Excel as
data source.
Code is attached below:
Dim wrdApp As Word.Application
Dim wrdDoc As Word._Document
Dim wrdMailMerge As Word.MailMerge
Dim fileWORDName, fileEXCELName As Object
Try
wrdApp = New Word.Application
wrdApp.ChangeFileOpenDirectory("C:\Inetpub\wwwroot\FPA\Templates\")
fileWORDName = "ThankYou-Shalini.doc"
wrdDoc = wrdApp.Documents.Open(FileName:=fileWORDName,
ConfirmConversions:=False, ReadOnly _
:=False, AddToRecentFiles:=False, PasswordDocument:="",
PasswordTemplate _
:="", Revert:=False, WritePasswordDocument:="",
WritePasswordTemplate:="" _
, Format:=Word.WdOpenFormat.wdOpenFormatAuto)
wrdMailMerge = wrdDoc.MailMerge
wrdMailMerge.MainDocumentType =
Word.WdMailMergeMainDocType.wdNotAMergeDocument
wrdApp.Visible = True
wrdDoc.ActiveWindow.Activate()
wrdDoc.ActiveWindow.Visible = True
wrdApp.ChangeFileOpenDirectory("C:\Inetpub\wwwroot\FPA\Archive\")
fileEXCELName = "FullfillmentReport1.xls"
wrdMailMerge.OpenDataSource(Name:= _
fileEXCELName, _
ConfirmConversions:=False, ReadOnly:=False,
LinkToSource:=True, _
AddToRecentFiles:=False, PasswordDocument:="",
PasswordTemplate:="", _
WritePasswordDocument:="", WritePasswordTemplate:="",
Revert:=False, _
Format:=Word.WdOpenFormat.wdOpenFormatAuto, Connection:= _
"DSN=Excel
Files;DBQ=fileEXCELName;DriverId=790;MaxBufferSize=2048;PageTimeout=5;" _
, SQLStatement:="SELECT * FROM 'Data'", SQLStatement1:="")
' Perform mail merge.
wrdMailMerge.Destination =
Word.WdMailMergeDestination.wdSendToNewDocument
wrdMailMerge.MainDocumentType =
Word.WdMailMergeMainDocType.wdFormLetters
wrdMailMerge.SuppressBlankLines = True
wrdMailMerge.DataSource.FirstRecord =
Word.WdMailMergeDefaultRecord.wdDefaultFirstRecord
wrdMailMerge.DataSource.LastRecord =
Word.WdMailMergeDefaultRecord.wdDefaultLastRecord
wrdMailMerge.Execute(False)
' Close the original form document.
wrdDoc.Saved = True
wrdDoc.Close(False)
Catch ex As Exception
Response.Write(ex.ToString)
Dim AllWORDProcess() As System.Diagnostics.Process =
System.Diagnostics.Process.GetProcessesByName("WINWORD")
Dim WordProcess As New System.Diagnostics.Process
For Each WordProcess In AllWORDProcess
WordProcess.Kill()
Next
WordProcess.Close()
Dim AllEXCELProcess() As System.Diagnostics.Process =
System.Diagnostics.Process.GetProcessesByName("Excel")
Dim ExcelProcess As New System.Diagnostics.Process
For Each ExcelProcess In AllEXCELProcess
ExcelProcess.Kill()
Next
ExcelProcess.Close()
Finally
' Release References.
wrdMailMerge = Nothing
wrdDoc = Nothing
wrdApp = Nothing
End Try
Please do the needful
3.MailMerge cannot open Access QUERY data source
I have a Word 2000 mail merge document that works fine when connecting to an
Access 2000 QUERY as its data source. However, when I try to open the (same
or even a new) document with Word 2003 and use an Access QUERY as its data
source, Word 2003 says it cannot open the data source. I have tried both
Access 2000 and Access 2003, but it seems to complain that there are either
no records or too few fields. Word 2003 does seem to be able to open an
Access TABLE as a data source, but not a QUERY.
Is there a different method that I can use to sucessfully use an Access
QUERY as a MailMerge data source? Thanks.
Chuck Hartman
4.Data source for mailmerge not selecting all data - PLEASE hel
Hi,
I have the same trouble when connecting to the data source using DDE - that
is, it doesn't appear to contain all of my information in excel and does not
include some rows. Is there something else that I am doing wrong?
Kind regards,
"Doug Robbins - Word MVP" wrote:
> Try connecting to the data source using DDE.
>
> --
> Hope this helps.
>
> Please reply to the newsgroup unless you wish to avail yourself of my
> services on a paid consulting basis.
>
> Doug Robbins - Word MVP
>
> "Katie" < XXXX@XXXXX.COM > wrote in message
> news: XXXX@XXXXX.COM ...
> > Hi all,
> >
> > I am wondering if someone could please help - I am lost/baffled as to what
> > I
> > may be doing wrong. I'm doing a mail merge using an excel table as my data
> > source. When I choose OLE DB Database Files, all of my data is selected, I
> > can filter accordingly and complete the mail merge. However, there are
> > many
> > cells in my worksheet which contain more than 256 characters, so these
> > come
> > across as incomplete. If I change the data source to be Excel Files via
> > ODBC
> > (*.xls,xlsx, xlsm,xlsb), then I get the full text from my excel file,
> > however
> > it appears to not include some rows and not show the information. As I
> > really
> > need all of the characters, I really need to choose the data source as
> > ODBC,
> > but I have no idea why it is not including some information from my excel
> > file.
> >
> > Could someone please help me out? I have been through the help files and
> > can't find anything.
>
>
>
5.Word 2002 - Mailmerge templates changing data source via VB
I have hundreds of Mail Merge templates which use a text file in a given
directory.
I want to open each template in vb and save it as a non mailmerge document
This should me to relocate the merge documents to a new directory.
Looking at other posts something like
ActiveDocument.MailMerge.MainDocumentType = wdNotAMergeDocument is needed.
However I get the 2 Dialog boxes
"xxx is a mail merge main document. Word cannot find its data source"
"Remove Data Header or Remove All Merge Information " works fine but I want
an automatic process
These pop up soon after opening the document and before AutoOpen
which I have created in my normal.dot
Sub AutoOpen()
'
' AutoOpen Macro
' Macro created 07/05/2006 by JCHAPMAN
'
ActiveDocument.MailMerge.MainDocumentType = wdNotAMergeDocument
MsgBox "Auto open" & vbCr
End Sub
There is a thread for Peter Jamieson 2/04/2006 but as it was only one
document the change was made manually.
Any suggests will be gratefully received.
6. Word basic mailmerge, changing data source file name from .doc to .txt
7. Preventing mailmerge "select data source" dialog
8. VBA Word 2002 mailmerge doc does not have data source attached