Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / December 2005

Tip: Looking for answers? Try searching our database.

suppressing requestor in Mail Merge

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
bhsmaths - 27 Dec 2005 22:56 GMT
G'Day,
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
in a fourth excel sheet. The program then opens a word document and
mail-merges this final excel sheet. Everything is working fine, but there is
one thing I would like to modify. Currently when I Mailmerge to the word
document the program displays an alert to confirm that I wish to use a
specific table (there is only one sheet to the excel file). How can I bypass
this requestor so that word automatically loads the table without alerts. I
have turned of DisplayAlerts with no difference. Thanks for any assistance.
Allan R Smyth (Australia)
Cindy M  -WordMVP- - 28 Dec 2005 15:01 GMT
Hi Bhsmaths,

> 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.

Version of Word? Can you describe this "requestor" in more detail?

I take it your code is opening the Word document; is it also attaching the data
source? It sounds as if this message could be appearing because your code isn't
providing all the necessary information for attaching the data source?

If that's the case, try recording a macro in Word that attaches the data
source, then transfer the result into your project. If you're still having
problems after that, copy the part of the code that deals with Word into your
reply (and don't forget the version, as that's extremely important for 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 - 29 Dec 2005 08:27 GMT
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.