Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Problem in Office Control

Hi all,

I am trying to work with office control. I had created a value node called "DocumentSourceNode".

created a supply function with the name fillNode.. Under fillNode i wrote the following code.

ISimpleTypeModifiable mod = node.getNodeInfo().getAttribute("DocumentContent").getModifiableSimpleType();

ModifiableBinaryType bin = (ModifiableBinaryType)mod;

bin.setMimeType(new WebResourceType("doc", "application/msword", false));

IPrivateOfficeView.IDocumentSourceNodeElement element = wdContext.nodeDocumentSourceNode().createDocumentSourceNodeElement();

node.addElement(element);

String filename = "";

try

{

filename = WDURLGenerator.getResourcePath(wdComponentAPI.getDeployableObjectPart(), "example.doc");

byte[] bytes = getBytesFromFile(new File(filename));

element.setDocumentContent(bytes);

}

catch (WDAliasResolvingException e)

{

throw new WDRuntimeException("No datasource available: " + filename);

}

catch (IOException e) {

//handle exception

}

when i am executing, i am getting this exception....

catch (WDAliasResolvingException e)

{

throw new WDRuntimeException("No datasource available: " + filename);

}

I had stored a msword document say example under mime/applications/com.sap..../example... am i stored the document in a right area? Please help me....

Not what you were looking for? View more on this topic or Ask a question