index > Visual Studio Tools for Office > Can't load CustomXMLParts since Technical Refresh

Can't load CustomXMLParts since Technical Refresh


Hi!

I'm working on a data export function from our software into Word2k7, using
CustomXMLParts therefore to save the Data to docx and a COM-AddIn to step
through the single DataSets.

Everything worked pretty fine until i updated to the Technical Refresh.

Now i can't get the CustomXMLParts out of the docx anymore.
I checked the unzipped docx files and they are alright - they got the
correct GUID, but when i call for (from the Add-In):
Office.CustomXMLPart customXML = _Doc.CustomXMLParts.SelectByID(MYGUID);
it returns null - but that's just since the technical refresh!

Did they change anything concerning this? I've already read thousands of
blogs (or maybe a few dozens ;)) but I haven't found anything helpfull ...
hope somebody can help me - i really got stuck on this

thx in advance!

also postet this on: http://www.microsoft.com/office/community/en-us/default.mspx?dg=microsoft.public.word.vba.general&lang=en&cr=US

johnny_good

Hi Johnny

Yes, the file formats have changed (again); MS even warns that entire files created in earlier betas may not be accessible in the B2TR. You should find some information at pschmid.net, including a list of some of the possible results of the change. I'm not sure whether Patrick also has your problem listed, but it definitely could be a result of the file format change.




-- Cindy Meister (Word MVP)
Cindy Meister

hmmm ... thx, but i don't think it's a problem of file format changing ... because i fill the docx with the custom xml programatically also in the b2tr - and when i start XML Data Store Explorer in Word i can see all added Data correctly and when i open the file ..\customXml\itemProps1.xml it has its entry:
<ds:datastoreItem ds:itemID="MYGUID" xmlns:ds="http://schemas.openxmlformats.org/officedocument/2006/2/customXml">
<ds:schemaRefs><ds:schemaRef ds:uri="http://schemas.mycompany.com/2006/customTags"/></ds:schemaRefs></ds:datastoreItem>

so, the guid is assigned correctly too, but out of the Add-In i only get a NULL-Value when i call:
Office.CustomXMLPart customXML = _Doc.CustomXMLParts.SelectByID(MYGUID);
i really get desperated about this, cause i need it urgent...

thx anyway

johnny_good

Hi Johnny

Hmmm, might be looking at a bug. But we'd need more detail on exactly how you're setting this up (repro steps) to test/confirm.




-- Cindy Meister (Word MVP)
Cindy Meister

Well, thats very complex how i'm generating/injecting the Custom XML into docx, but in most simple words:
well, I generate all needed files/folders on my own programatically (customXML/item1-3.xml;itemProps1-3.xml;/_rels/item1-3.xml.rels)
when i set up the connection for the dataset it's guid is set to my special guid; then i add my columns and rows needed (most likely stuff like: firstname, surname, ...)
this happens when the word-file is opened out of our program and hasn't yet any custom xml.

then i got 2 COM Add-Ins - 1 has just a DocumenentOpenEventHandler and activates the second, which should insert Content Controls, but i need to check, if the file has my CustomXML which is needed for the Content Controls of course ... so i call:
Office.CustomXMLPart customXML = _Doc.CustomXMLParts.SelectByID(MYGUID);
and here is where i get my NULL value ...
maybe i could send you a docx-file with my CustomXML injected, so you could try a bit with it ...

but I'm NOT using the new windows SDK - and i MUST NOT use it ...

thx for your quick answer

johnny_good

The namespace of the custom XML data properties part you're writing is from Beta2, and so Word doesn't load it. If you remove the /2/ from the namespace, it should work, since then it's the correct final namespace.

Tristan

Tristan Davis

well, thx - that's a good hint, but it still doesn't work ..

what i've found out now is:
xmlWriter.WriteLine(@"<ds:datastoreItem ds:itemID=""" + _Con.Guid +@""" xmlns:ds=""http://schemas.openxmlformats.org/officedocument/2006/customXml"">");

simple doesn't write the correct ID into the itemPropsX.xml file ..

somehow the itemID is getting changed to some newly generated one and that's why i can't get my CustomXMLParts by ID of course ...

well, i'm already working a few days on this problem but i can't manage it to work properly - i've achieved to actually get my CustomXMLParts, but in a unsecure, unclean way :)

anyone else experienced that problem as well??

johnny_good
reply 7

You can use google to search for other answers

 

More Articles

Save worddocument
Two Excel Addin questions
VSA deployment for .Net 2.0?
How to use Excel and Word from Office XP,Office 2000?..
word xml layout
VSTO and OLE Automation
Action Pane
Publishing Issue VSTO Word Project
Issue with UpdateCommand
Toolbar Appearance Issue with Word & WordMail
Welcome to Bokebb   New Update   Joins the collection  
 

New Articles

Word2007 Add-In: Can I customize the Wor…
AccessViolationException opening Excel w…
Action Pane Disappear
argument display and description for Use…
A good Drag&Drop question in VSTO
Moving Outlook Add-in to VSTO 2005?
VSTO 2005 Application can NOT run in Off…
vsto 2005 Schma file deployment
Trying to access Excel Spreasheet from V…
Accessing Action Pane in Word Automation
Sheet level protection
How to generate XSLT file from WordProce…
Binding Keys
Macros in Excel for Exporting Tables to …
VSTO Deployment

Hot Articles

VSTO Installation included in Visual Stu…
Freeze Pane in VSTO2005
a problem in setting a custom color over…
Internet Explorer causes vsto worksheets…
adding data in a new added sheet in exce…
Parse Control on Action Pane by VSTO
How to add SmartTags in Outlook
general doubts
VSTO Cypress : Where's the CTP?
Communicating with Outlook like ActiveSync
ms access vba tiff image handling
VSTO2005 vs. VS2005Prof
Set the cursor's position
taskpane
VB.net equivalent of "Selection"

Recommend Articles

Need Help: Suggest an approach!!
UDF in Excel XP with C#
Drawing XY Scatter Graph With OWC11
[VSTO v3 / Office 2007] Get value from a…
Loading a image at runtime in Crystal Re…
BackgroundWorker problems with VSTO
How to Show Complete Format Cells dialog
File error : Data may be lost
ActionsPane and IDTExtensibility2
If an Add-In won't load, then what?
Problem regarding the add ins for outlook
Word Undo
subreport's report header and report foo…
Can't load CustomXMLParts since Technica…
Formatting / AutoFit