cancel
Showing results for 
Search instead for 
Did you mean: 

Urgent .. how to call the WordDocument from mimesfolder using OfficeControl

Former Member
0 Kudos

Dear All

I want to show the Predefined WordDocuemnt from the Webdynpro UI(Any) element.

I have Written following coding in the init method

*******************************************************

try

{

IWDAttributeInfo attributeInfo =wdContext.getNodeInfo().getAttribute(IPrivatePopUpView.IContextElement.ATTR_CONTENT);

IWDModifiableBinaryType binaryType =(IWDModifiableBinaryType) attributeInfo.getModifiableSimpleType();

String resourcePath = WDURLGenerator.getResourcePath(wdComponentAPI.getDeployableObjectPart(),PopUpView.FILE_NAME);

wdContext.currentContextElement().setAttrContent(this.getByteArrayFromResourcePath(resourcePath));

binaryType.setFileName(PopUpView.FILE_NAME);

binaryType.setMimeType(WDWebResourceType.DOC);

}

catch (Exception e)

{

throw new WDRuntimeException(e);

}

and in the Method

*********************

private byte[] getByteArrayFromResourcePath(String resourcePath)

throws FileNotFoundException, IOException {

FileInputStream in = new FileInputStream(new File(resourcePath));

ByteArrayOutputStream out = new ByteArrayOutputStream();

int length;

byte[] part = new byte[10 * 1024];

while ((length = in.read(part)) != -1) {

out.write(part, 0, length);

}

in.close();

return out.toByteArray();

}

private static final String FILE_NAME = "Example.doc";

Instead of the MSWord document I have a wonderfull blue component where it is written "I am the PlaceHolder control".

How to call the WordDocument from the Webdynpro using OfficeControl in NWDS2004

thanks in advance

J Dhinakaran

Message was edited by:

Dhinakaran Jeyachandran

Message was edited by:

Dhinakaran Jeyachandran

Message was edited by:

Dhinakaran Jeyachandran

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

These blogs by Anilkumar would be helpful for you.

/people/anilkumar.vippagunta2/blog/2007/02/01/office-control-in-webdynpro--i

/people/anilkumar.vippagunta2/blog/2007/02/01/office-control-in-webdynpro--i

Regards,

Nagarajan

Former Member
0 Kudos

Dear All

is the above link will work in 2004?

Because i am unable to declare the following variable in 2004

public IWDIOSFactory factoryInstance;

public IWDIOSDocument documentInstance;

Guide me

Dhinakar J

Message was edited by:

Dhinakaran Jeyachandran

Answers (0)