opening a word document using flex or actionscript

425 views
Skip to first unread message

blpancholi

unread,
Jul 19, 2007, 6:29:07 AM7/19/07
to Flex India Community
DEar all,

Can anyone tell me the method to open a microsft word document using
flex or Action script.

Thanking you in advance

Waiting for reply.

oviya selvan

unread,
Jul 20, 2007, 12:56:45 AM7/20/07
to flex_...@googlegroups.com
Hi,

  To interact with OS file system you can use MDM Zinc.

For example to open notepad using zinc,you can use following command

    mdm.System.exec ("Notepad.exe");


--
Regards,
Oviyan

Blog     :  http://www.oviyas.blogspot.com/
contact :  +919841141729

karan

unread,
Jul 20, 2007, 12:59:50 AM7/20/07
to flex_...@googlegroups.com
Oviyan,
    I think he wants to open a word document from the browser. MDM Zinc is for creating desktop applications.
--
regards
karan
mindrulers.blogspot.com

oviya selvan

unread,
Jul 20, 2007, 1:40:04 AM7/20/07
to flex_...@googlegroups.com
Hi,

     Ohh..Thanks karan.

     If he wants to open the word document from browser, he can use javascript to create the Microsoft word object then can pass the file name using External interface and open the file. The syntax is here

var oApplication=new ActiveXObject("Word.Application");
oApplication.Documents.Open("myfilename");

Anish Kumar

unread,
Jul 20, 2007, 1:37:04 AM7/20/07
to Flex India Community
Hi,

If you are looking at ways of opening MS Office documents like word,
excel etc in Flex, then you can use Microsoft Office Web
Components" (OWC). But using OWC requires the client to have MS Office
installed on his machine. A similar question of opening an excel sheet
was discussed earlier in this group and a possible alternate for using
OWC is also discussed. You can check the below thread for more
detailed information.
http://groups.google.com/group/flex_india/browse_thread/thread/e615010d8260e149/e87bb5bff53ddd50?lnk=gst&q=owc&rnum=1#e87bb5bff53ddd50

Hope it helps you....

regards,
-Anish Kumar


On Jul 20, 9:59 am, karan <karan.pra...@gmail.com> wrote:
> Oviyan,
> I think he wants to open a word document from the browser. MDM Zinc is
> for creating desktop applications.
>

> On 7/20/07, oviya selvan <srioviy...@gmail.com> wrote:
>
>
>
>
>
> > Hi,
>
> > To interact with OS file system you can use MDM Zinc.
>
> > For example to open notepad using zinc,you can use following command
>
> > mdm.System.exec ("Notepad.exe");
>

Vijay

unread,
Jul 20, 2007, 12:07:04 AM7/20/07
to Flex India Community
You can use navigateToURL method and can specify the path of your
microsoft doc.

var u:URLRequest = new URLRequest("http://localhost/flex/
microsoft.doc");
navigateToURL(u,"_blank");

Hope this helps

Vijay Khambalkar
vijayk.wordpress.com

blpancholi

unread,
Jul 23, 2007, 3:38:51 AM7/23/07
to Flex India Community
Thanx Oviyan & karan,
actually i want to open a document store in blob field of a mysql
database. for this i use java servlet / Hybernate as backend. and i
don't want to store document in temporary folder before opening it.
So i need help in this matter, if u have any dea for teh same then i
will help me,

On Jul 20, 10:40 am, "oviya selvan" <srioviy...@gmail.com> wrote:
> Hi,
>
> Ohh..Thanks karan.
>
> If he wants to open the word document from browser, he can use
> javascript to create the Microsoft word object then can pass the file name
> using External interface and open the file. The syntax is here
>
> var oApplication=new ActiveXObject("Word.Application");
> oApplication.Documents.Open("myfilename");
>

> On 7/20/07, karan <karan.pra...@gmail.com> wrote:
>
>
>
>
>
>
>
> > Oviyan,
> > I think he wants to open a word document from the browser. MDM Zinc is
> > for creating desktop applications.
>

> > On 7/20/07, oviya selvan < srioviy...@gmail.com> wrote:
>
> > > Hi,
>
> > > To interact with OS file system you can use MDM Zinc.
>
> > > For example to open notepad using zinc,you can use following command
>
> > > mdm.System.exec ("Notepad.exe");
>

> > > On 7/19/07, blpancholi < blpanch...@gmail.com> wrote:
>
> > > > DEar all,
>
> > > > Can anyone tell me the method to open a microsft word document using
> > > > flex or Action script.
>
> > > > Thanking you in advance
>
> > > > Waiting for reply.
>
> > > --
> > > Regards,
> > > Oviyan
>
> > > Blog : http://www.oviyas.blogspot.com/
> > > contact : +919841141729
>
> > --
> > regards
> > karan
> > mindrulers.blogspot.com
>
> --
> Regards,
> Oviyan
>
> Blog : http://www.oviyas.blogspot.com/

> contact : +919841141729- Hide quoted text -
>
> - Show quoted text -

blpancholi

unread,
Jul 23, 2007, 3:39:06 AM7/23/07
to Flex India Community

Thanx Oviyan & karan,
actually i want to open a document store in blob field of a mysql
database. for this i use java servlet / Hybernate as backend. and i
don't want to store document in temporary folder before opening it.
So i need help in this matter, if u have any dea for teh same then i
will help me,

> > Waiting for reply.- Hide quoted text -

Anish Kumar

unread,
Jul 23, 2007, 4:24:18 AM7/23/07
to Flex India Community
Hi,

I think this question is more related to JavaServlet/Hybernate than
Flex.

I assume your current work flow is that you make a request to
Javaservlet from Flex and then Javaservlet fetches the word doc frm
MYSQL and stores in an temp directory which is later fed to Flex. If
this is the case, then I think you can bypass the temp directory by
making a HTTPRequest to the Javaservlet and make the JavaServlet
return the word document from MYSQL in a POST/GET variable to Flex.
Then may be Flex can process the word document which you would have
stored in a String var in Flex. (This holds good provided the blob you
are fetching from mysql is an exact copy of the word document)

hope this helps.

regards,
-Anish Kumar

blpancholi

unread,
Jul 23, 2007, 9:17:36 AM7/23/07
to Flex India Community
Thanx anish ,
u r right , u get my problem right this time, but mysql return bytes
nt word documents , so how can i send these bytes to flex and display
on a browser.
if any other solution in servlet where i directly shows the document
from servlet contenttype. then u can help me , i am new in this field.
If u write me some functions or objects in java or flex who can store
word document then please send the same to me. so i store the bytes in
these object and display the objects.

hoping for more mutual relationship in future.

with kind regards,

> > > - Show quoted text -- Hide quoted text -

oviya selvan

unread,
Jul 24, 2007, 1:39:14 AM7/24/07
to flex_...@googlegroups.com
Hi,

    You can use varchar as a data type then you can go with anish idea..

Anish Kumar

unread,
Jul 24, 2007, 3:25:51 AM7/24/07
to Flex India Community
Hi Pancholi,

I got a doubt here. May be you are getting bytes from MYSQL, but at
the end when you feeding those bytes to a temp file, you must be
capturing it in some variable which is constantly updated with new
bytes that comes from MYSQL may be thru a "for/while" loop. And
finally when you are about to write to the temp file, i think you must
be having the entire word doc in a variable inside a JavaServlet file.
If thats the case I am not sure what is the problem you are facing in
dealing with that variable to be fed directly to flex instead of it
going to a temp file and then back to Flex.

May be its time now that you should explain in more detail how you
capture data from mysql and feeding to your temp file. (i mean i want
to know the logic only..not the code...i dont understand Java :-( )

regards,
-Anish Kumar

On Jul 24, 10:39 am, "oviya selvan" <srioviy...@gmail.com> wrote:
> Hi,
>
> You can use varchar as a data type then you can go with anish idea..
>

blpancholi

unread,
Jul 24, 2007, 8:46:36 AM7/24/07
to Flex India Community
Hi anish,
Ultimately we got the solutions, we send the request to java servlet
to access data from MYSQL table ( store in blob field) then we set
contenttype to "application/msword" then send the bytes to a browser
window directly , then we able to open the document in word.
for sending request to servlet (calling servlet) we use URLRequest
object & after receving the bytes from servlet in servlet path end, we
us navigatetourl function to open url in different location.

var u:URLRequest = new URLRequest("http://localhost/application/
servlet:?id="+id);
navigateToURL(u,"_blank");

but thanx for responding my mail,


BL Pancholi

> > contact : +919841141729- Hide quoted text -

Anish Kumar

unread,
Jul 25, 2007, 2:18:49 AM7/25/07
to Flex India Community
This reply seems to suggest that you opened the word document direct
in the browser and not inside Flex. Well just for your information, we
can also open word documents inside a flex app and thats what i was
refering above.

anyways if that solves your problem...cheers :-)

-Anish Kumar

Reply all
Reply to author
Forward
0 new messages