If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
MailMergeDataSource iteration extremly slow
Hi
I'am reading addresses from a MailMergeDataSource in Word 2007. My problem is, that this is extremly slow. Every invoke from get_Item will take a sec. The app is a C# Word 2007 Application Add-In. Is there some solution to speed it up or an another approach to solve the issue? Code: object indexLastname = MailMergeDataFieldIndices.Lastname; object indexFirstname = MailMergeDataFieldIndices.Firstname; object indexCompany = MailMergeDataFieldIndices.Company; object indexStreet = MailMergeDataFieldIndices.Street; object indexZip = MailMergeDataFieldIndices.Zip; object indexCity = MailMergeDataFieldIndices.City; object index = MailMergeDataFieldIndices.None; for (int i = 0; i count; i++) { string name = fields.get_Item(ref indexFirstname).Value + " " + fields.get_Item(ref indexLastname).Value; string company =fields.get_Item(ref indexCompany).Value; string street =fields.get_Item(ref indexStreet).Value; string zip = fields.get_Item(ref indexZip).Value; string city = fields.get_Item(ref indexCity).Value; dataSrc.ActiveRecord = Word.WdMailMergeActiveRecord.wdNextDataSourceRecor d; } Thanks in advance amr |
Thread Tools | |
Display Modes | |
|
|