Error: Part URI must start with a forward slash

Oct 18, 2010 at 8:49 PM

Hi,

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);  
                document.Save();
            }

Any ideas?

Thanks for yor help.

Elvis

Coordinator
Oct 19, 2010 at 8: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,
Cathal
Oct 26, 2010 at 5: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.

Elvis

Nov 17, 2010 at 6: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.

 

Thanks

Coordinator
Nov 17, 2010 at 7:46 PM
srwright,

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.

Cheers,
Cathal
Nov 20, 2010 at 2: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!

Sean