Word Mail Merge recordcount returns -1

Yet that stops me coming from repeating the mail merge (when he utilizes the helper, he can easily still activate the usual mail combine features including seeing the result of the merge).

When they utilize this nevertheless, my ActiveDocument.MailMerge.DataSource.RecordCount profits -1. Which implies that it can’t determine the amount of reports in the datasource. My expectation is actually that the Mail Merger Helper doesn’t specify the datasource the right way.

I am actually trying to look at a data source for a word mail merge document in c# https://www.iditect.com/tutorial/word-mail-merge/.

Currently the user that I am actually producing this for are, as a result of various other explanations, making use of the tiny assistant feature: Mail Merger Helper (it exists in Word 2010).

Currently everything works really effectively. I run through the information resource and perform what I need to have to do.

What mistakes? Is there an alternative to iterating the combine, so I can obtain the reports one by one?

When you established the ActiveRecord to wdLastRecord. You may go through the last information source off of ActiveRecord. So I just required to snatch that, and then set ActiveRecord to wdFirstRecord once again.

Nonetheless, that only definitely functions if you recognize that the mail combine primary document merely takes in 1 information source record each time. It may take in several files every model if it has fields such as NEXT in it. You may seek to skip the appropriate number of files if you recognize how a lot of. If the variety can differ (e.g. by means of NEXTIF statements, it is actually certainly not obvious just how you may discover in VBA specifically how many records have actually been consumed in each merge.

Regrettably, for some records sources, Word does specify the RecordCount to -1. Sometimes, that may be actually an outcome of Word utilizing an ADO/OLE DB link, considering that for instance, when you fetch a RecordSet using CONFUSION, you at times must use.MoveLast to recover the real file matter, and also that depends on the ADO Cursor style as well as other CONFUSION settings. Also for a DDE link to Excel Word can easily return a -1 recordcount.

The principal downside is actually LiveDocx is web-service based. Our experts are actually trying to change LiveDocX if you want to minimize our dependence on the up-time of a third-party web-service that we can certainly not manage.

For mail merge (various document results based upon multiple reports, point out, from a data source), you can easily use either the Open XML SDK for a VS remedy or even access the Open XML straight. In that scenario, these are good articles initially:.
Mail Merge in WordProcessingML.
Mail Merging along with a Custom-made Client Making Use Of the Open XML SDK 2.0.
For direct single-document population along with information, these are good collections that utilize PHP:.
PHP Word.
PHP OpenXML API (not unbelievably mature, yet a beginning factor).

I wasn’t entirely very clear precisely what you required to become able to accomplish, yet in some cases you can easily create the current most extensive record variety through specifying.

Presently this functionality is carried out using LiveDocX. Our team have a standing record template, as well as LiveDocX carries out the merge in to the design template using data from our job monitoring resource.

Our use is actually an online job management resource constructed making use of Xataface – PHP on Windows IIS + mySQL. Our team have a feature that makes it possible for the consumer to generate a standing report in Microsoft Word layout based on information in the resource.

I am actually certainly not fully sure that even that is actually good enough. For something, if the data source is actually a multi-user data source, it is actually certainly not impossible that the report matter can alter in the course of the merge, therefore setting.lastrecord at the start might not really work (although I would possess presumed that in most cases, you would really be actually obtaining and processing the documents in a Deal, in which situation you ‘d perhaps view the very same set of files during). You may handle that possibility through making an effort to increment the.ActiveRecord in each model. if you have reached the edge of the files. ActiveRecord will certainly not increment. On Microsoft window Word, you might likewise have to deal with the probability that the consumer can easily omit individual documents using the Edit Recipient Checklist dialog. In that situation, when you attempt to increment.ActiveRecord, it is going to actually avoid to the next Included/Selected record (if any sort of) and Word may additionally raise a mistake. The following shows how you might be capable to code for all the probabilities I understand on Windows Word.

Does anyone possess any kind of ideas on an online document merge solution that I can put in on my IIS or PHP based server?

In reading your question, I am actually not exactly sure if what you seek is actually real mail merge or even only merely filling a solitary Word theme server-side. Here are some factors to acquire your started:.

Leave a Reply

Your email address will not be published. Required fields are marked *