Skip to Content
author's profile photo Former Member
Former Member

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....

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Sep 22, 2008 at 06:43 PM

    try to place the file in

    src/mimes/components/..../

    -Aarthi

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.