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

Error: Part URI must start with a forward slash

Oct 18, 2010 at 9:49 PM


I am new to using DocX and tried to use it to replace some text in a word document.  However I am getting an error:  Part URI must start with a forward slash when the document.Save(); is executed.

Here is the code which is exactly like the examples:

            using (DocX document = DocX.Load(@"c:\testfile.docx"))
                document.ReplaceText("<REPORT_TITLE_TEMPLATE>", "Employee Data", true, RegexOptions.IgnoreCase);  

Any ideas?

Thanks for yor help.


Oct 19, 2010 at 9:46 AM
Hi elvism3,

can you please download and build the latest version from Source? I believe this contains a fix for the issue you are talking about.

Kind regards,
Oct 26, 2010 at 6:01 PM

Thanks for the response Cathal.

I had started with the latest version 55074.  This is my first time using DocX.  This is the same version that is currently giving me the issue.  I am using word 2007 and VS project is set to CLR 3.5.

Anything else I can try? 

Thanks for your help.


Nov 17, 2010 at 7:17 PM

I too am having this problem.  Has anyone found a solution?  I have rebuilt the latest version of the source to no avail.



Nov 17, 2010 at 8:46 PM

can you please send me a document and code snippet that are causing this error to be thrown. It would help if the document and code snippet are as simple\small as possible. I will then use this data to debug the problem.

Nov 20, 2010 at 3:12 PM

Hey Cathal (et al),

I was able to resolves the issue by including the source for DocX in my own solution and then referencing it in my project.  When I built the solution and ran it, the problem disappeared!


Hope this helps!