Hi;
I tried this and I am getting:
+ ctrl.XMLMapping.CustomXMLPart
'ctrl.XMLMapping.CustomXMLPart' threw an exception of type
'System.Runtime.InteropServices.COMException'
Microsoft.Office.Core.CustomXMLPart
{System.Runtime.InteropServices.COMException}
System.Runtime.InteropServices.COMException occurred
Message="Error HRESULT E_FAIL has been returned from a call to a COM
component."
Source="Microsoft.Office.Interop.Word"
ErrorCode=-2147467259
StackTrace:
at Microsoft.Office.Interop.Word.XMLMapping.get_CustomXMLPart()
at
AutoTag2010.net.windward.autotag.word.WordTagHandler.FindAllTags(Selection
selOn, Boolean justFirst, Int32 startSearch, Int32 endSearch) in
C:\src\version9\AutoTag\AutoTag2010\net\windward\autotag\word\WordTagHandler.cs:line
545
InnerException:
??? - thanks - dave
Hello Dave,
We can store the long string in ContentControl's CustomXML. In details, the
ContentControl.XMLMapping.CustomXMLPart has a description node. So we can
store the long string there,
The following VBA codes work fine for me,
Sub Test()
Dim description As CustomXMLNode
Set description =
ActiveDocument.ContentControls(1).XMLMapping.CustomXMLPart.SelectSingleNode(
"/ns1:coreProperties[1]/ns0:description[1]")
description.Text =
"ttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt
ttttttttttttttttt"
End Sub
Sub Test2()
Dim description As CustomXMLNode
Set description =
ActiveDocument.ContentControls(1).XMLMapping.CustomXMLPart.SelectSingleNode(
"/ns1:coreProperties[1]/ns0:description[1]")
Debug.Print description.Text
End Sub
Test Sub set a 90+ characters long string and Test2 Sub prints it out.
Best regards,
Ji Zhou
Microsoft Online Community Support
david@
[email protected]
Windward Reports --
http://www.WindwardReports.com
me --
http://dave.thielen.com
Cubicle Wars -
http://www.windwardreports.com/film.htm