I would like to transfer blob memo fields through Style Sheet ToolW11.1 to Ms Word. I expect memos about 10kB length. This tool does not support blobs, so I must modify codeunit 682 (Style Sheet Data Management).
variables: BSTRConv as 'Navision Attain Hash 1.0'.BSTRConverter
ChildNode as 'Microsoft XML, v4.0'.IXMLDOMNode
ChildNode := ParentNode.ownerDocument.createNode('element',NodeName,'');
CREATE(BSTRConv);
WHILE NodeTextStream.EOS = FALSE DO BEGIN
NodeTextStream.READTEXT(temp, 1024);
BSTRConv.AppendNextStringPortion (temp);
END;
ChildNode.text (BSTRConv.BSTR); //error at this line
ParentNode.appendChild(ChildNode);
CreatedChildNode := ChildNode;
When stream has more than 1024 characters, I’ve got an error: “The length of the text string exceeds the size of the string buffer”.
Is any way to solve this problem?
PS: NAV 5.0 SP1
0
Comments
You did, however, overlook the fact that Microsoft XML (MSXML) Automation allows streams.
(I've gotta make a b-line for the door since I'm off work but here is some code. I am sure you will find what you are looking for in this example)
I’ve declared xmldom as 'Microsoft XML, v4.0'.IXMLDOMDocument2, but I’ve got error message: Could not create an instance of the OLE control or Automation server identified by GUID {guid} 4.0: {guid}: ‘Microsoft XML, v4.0’.IXMLDOMDocument2.
And make sure to create an instance of the automation...
I menage to overcome this problem but now I have another error, which I don't know how to solve.
The Error popup says:
The call to member appendChild failed. msxml4.dll returned the fallowing message:
It is an error to mix objects from different versions of MSXML
They are of the same version. But thank You for a try. Maybe some other ideas...
Downgrading automation variables from "'Microsoft XML, v6.0'.DOMDocument60" to "'Microsoft XML, v4.0'.DOMDocument40" solved the issue...