BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Word Mail Merge using Excel spreadsheet

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi OLE Automation
View previous topic :: View next topic  
Author Message
David
Guest





PostPosted: Thu May 10, 2007 8:39 pm    Post subject: Word Mail Merge using Excel spreadsheet Reply with quote



I'm trying to do a mail merge using an excel spreadsheet, but using
the following OpenDatasource command, but Word asks which workbook
(Sheet1, Sheet2, Sheet3) to use. How can I tell it to automatically
use Sheet1?


wrdDoc.MailMerge.OpenDatasource(
MergeFile , // Name
{nil} , // Format
False , // ConfirmConversions,
True , // ReadOnly
{nil} , // LinkToSource
{nil} , // AddToRecentFiles
{nil} , // PasswordDocument
{nil} , // PasswordTemplate
{nil} , // Revert
{nil} , // WritePasswordDocument
{nil} , // WritePasswordTemplate
'Entire Spreadsheet' , // Connection
{nil} , // SQLStatement
{nil} );// SQLStatement1

Thanks,

David
Back to top
Oliver Townshend
Guest





PostPosted: Fri May 11, 2007 8:13 am    Post subject: Re: Word Mail Merge using Excel spreadsheet Reply with quote



Quote:
I'm trying to do a mail merge using an excel spreadsheet, but using
the following OpenDatasource command, but Word asks which workbook
(Sheet1, Sheet2, Sheet3) to use. How can I tell it to automatically
use Sheet1?

The easiest way to find out what word wants to do is to record a macro of
the task you want automated, and examine the code. I'm sure that will work
in this case.

Oliver Townshend
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi OLE Automation All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.