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 / Mailmerge and Fax / April 2006

Tip: Looking for answers? Try searching our database.

Hide dialogs on mailmerge

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
zSplash - 24 Apr 2006 19:55 GMT
How do I hide the DataSource dialog and the Header dialog on mail merge?

For example, when the following code runs, I don't want to see it:
   If ActiveDocument.MailMerge.DataSource.Name = "" Then
       MergeSetup
       GoTo getDataSource
   End If

TIA
Peter Jamieson - 25 Apr 2006 07:42 GMT
Not sure which particular problem you are encountering.

Is the DataSource dialog appearing when you execute the
ActiveDocument.MailMerge.DataSource.Name = ""
line (it doesn't here if there is no mail merge data source) or as a result
of code in your MergeSetup routine?

I would say the main point is that once you call OpenDataSource, you are at
the mercy of the method and if it chooses to display a dialog box, you won't
be able to suppress it (except possibly by working directly with the Windows
API). The only way to avoid that is to ensure that the method always works,
i.e. the data source is always where you say it is, there are never any
"gotchas" opening it, and the OpenDataSOurce always provides enough info. to
avoid the dialog. IMO that is in the general case impossible, not least
becasue with some types of data source, you can't avoid a dialog.

You may also need to look at the following KB article:

"Opening This Will Run the Following SQL Command" Message When You Open a
Word Document"

at

http://support.microsoft.com?kbid=825765

Peter Jamieson

> How do I hide the DataSource dialog and the Header dialog on mail merge?
>
[quoted text clipped - 5 lines]
>
> TIA
zSplash - 25 Apr 2006 17:19 GMT
Thank you, Peter, for your help.

The system is very simple, so the method always work (hopefully (!)) --
(there's a built-in loop such that if there is not enough info, it loops to
find it), so it ALWAYS has enough data to merge.  I hear you saying there's
no way to turn off the dialogs.  (Rats!)

st.

> Not sure which particular problem you are encountering.
>
[quoted text clipped - 32 lines]
> >
> > TIA
Peter Jamieson - 25 Apr 2006 17:50 GMT
No, what I was saying is that for most types of connection, if the
connection info. in your OpenDataSource call is correct and complete then
the user shouldn't see prompts for either "Select Data Source", or the "Data
Link Dialog". Trouble is that in some circumstances Word pops up the OLEDB
Data Link dialog and/or the equivalent ODBC dialog if it doesn't think it
has enough info. to make the connection.

What kind of data source(s) are you trying to open, and what OpendDataSource
parameters are you passing?

(BTW if you search my articles in this NG via Google Groups or some such you
should find plenty of info. about this, though there is doubtless more to
know :-) )

Peter Jamieson

> Thank you, Peter, for your help.
>
[quoted text clipped - 50 lines]
>> >
>> > TIA
zSplash - 25 Apr 2006 22:43 GMT
Thanks for the help and direction, Peter.  I will search your articles, as
you suggest.

st.

> No, what I was saying is that for most types of connection, if the
> connection info. in your OpenDataSource call is correct and complete then
[quoted text clipped - 66 lines]
> >> >
> >> > TIA
 
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.