> I am fairly new to using word/excel within a VB project. Currently I have a
> project which uses 3 Excel sheets to write an order form and save the data
[quoted text clipped - 5 lines]
> this requestor so that word automatically loads the table without alerts. I
> have turned of DisplayAlerts with no difference. Thanks for any assistance.
Thanks Cindy,
I am accessing my word document from within a VB6.0 Form. I am using a file
"orders.xls" as a mail merge source.The code I am using is
f$ = dirx & "/" & "orders.xls":Rem dirx is home directory and orders.xls is
the mailmerge source
appword.DisplayAlerts = wdAlertsNone:rem I hoped this would bypass the
requestor but it seems to have no effect
With wdoc.MailMerge
.MainDocumentType = wdFormLetters
.OpenDataSource Name:=f$, _
ReadOnly:=True, _
Connection:="orders$"
End With
appword.DisplayAlerts = wdAlertsAll
Everything works as expected except a requestor pops up.
"Select Table".
This requestor has only one table "orders$" and as soon as I accept the
table ie click "OK", the mailmerge proceeds as required. How do I get it to
automatically accept this table and bypass the requestor. I have looked at
the VBA books in the local bookstores, but none cover Mailmerging from
within VB. The program has been written for teacher's assistant in the
science lab and needs to be kept as simple as possible (KISS).
Thank you again for your assistance.
Allan R Smyth
Mathematics department Blakehurst High School
> Hi Bhsmaths,
>
[quoted text clipped - 38 lines]
> reply
> in the newsgroup and not by e-mail :-)
bhsmaths - 29 Dec 2005 08:32 GMT
Hi Cindy,
Version is Word2003 SP1
Al S
Cindy M -WordMVP- - 29 Dec 2005 15:03 GMT
Hi Bhsmaths,
As I said, RECORD a macro in Word to get the necessary syntax. Providing only
the path and file name is usually not enough for Word 2003.
> I am accessing my word document from within a VB6.0 Form. I am using a file
> "orders.xls" as a mail merge source.The code I am using is
[quoted text clipped - 59 lines]
> > mail
> > merge questions).
Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org
This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :-)
bhsmaths - 30 Dec 2005 08:55 GMT
Hi Cindy,
I did not realise how useful the macro recorder was for assisting code
generation. Thank you for the advice.
Best wishes for the New Year.
Al S