This project has moved and is read-only. For the latest updates, please go here.

Sequence contains more than one element

Mar 17, 2011 at 5:02 PM

Merged multiple documents using altchunkid... now want to do a search/replace with docx.  Getting the following error:

"Sequence contains more than one element"

Is there something in my document afterbeing merged that could be causing this?

Code is below.

        private void GetPropertyFromDocument(string document, string outdoc)
            File.Copy(document, outdoc);
            using (DocX doc = DocX.Load(document))
                doc.ReplaceText("{Company Name}", txtClientName.Text);
                doc.ReplaceText("{Project No}", txtOppNo.Text);
                doc.ReplaceText("{Your Name}",  txtPreparedBy.Text);
                doc.ReplaceText("{Todays Date}", DateTime.Now.ToShortDateString());
                doc.ReplaceText("{Rev No}", txtRevNo.Text);
                doc.ReplaceText("{External Targets}", txtExtTargets.Text);
                doc.ReplaceText("{Web Apps}", txtWebApps.Text);
                doc.ReplaceText("{Pen Test}", txtPenTest.Text);
                doc.ReplaceText("{Primary Name}", txtPriContactName.Text);
                doc.ReplaceText("{Primary Title}", txtPriContactTitle.Text);
                doc.ReplaceText("{Primary Email}", txtPriContactEmail.Text);
                doc.ReplaceText("{Primary Phone}", txtPriContactPhone.Text);
                doc.ReplaceText("{Primary Address}", txtPriContactAddr.Text);
                doc.ReplaceText("{Primary City}", txtPriContactCSZ.Text);