OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

loading a file

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API
View previous topic :: View next topic  
Author Message
abogom
General User
General User


Joined: 02 Jul 2005
Posts: 6

PostPosted: Sat Jul 02, 2005 6:11 am    Post subject: loading a file Reply with quote

Could anybody please provide me with a working snippet of Java programming for loading a Word file into an OfficeBean.

I just began programming with OO; I need this small thing to start me off. Many sincerest thanks.

Alex
http://www.cut-the-knot.org
Back to top
View user's profile Send private message Visit poster's website
Cybb20
Super User
Super User


Joined: 02 Mar 2004
Posts: 1569
Location: Frankfurt, Germany

PostPosted: Sat Jul 02, 2005 9:05 am    Post subject: Reply with quote

Hi abogom, download the SDK from the download pages and look into the examples/java folder.

Hope this helps.
Christian
_________________
- Knowledge is Power -
Back to top
View user's profile Send private message Send e-mail
abogom
General User
General User


Joined: 02 Jul 2005
Posts: 6

PostPosted: Sat Jul 02, 2005 1:47 pm    Post subject: Reply with quote

Cybb20 wrote:
Hi abogom, download the SDK from the download pages and look into the examples/java folder.

Hope this helps.


No, Christian, it does not. I asked for a snippet, not the SDK, nor an advice. Something does not work in my settings. And since I am a newbie, there are too many things that might have gone wrong. So I asked for a snippet that an expert OO programmer knows to work. I would then compare and, if necessary, eliminate a couple of possibilities.

Thank you
Back to top
View user's profile Send private message Visit poster's website
abogom
General User
General User


Joined: 02 Jul 2005
Posts: 6

PostPosted: Sat Jul 02, 2005 3:58 pm    Post subject: Reply with quote

Cybb20 wrote:
Hi abogom, download the SDK from the download pages and look into the examples/java folder.

Hope this helps.
Christian


You know, it did help after all. There is an example for loading a document that contains an url creation:

Code:

      String sUrl = args[0];
      if ( sUrl.indexOf("private:") != 0) {
          java.io.File sourceFile = new java.io.File(args[0]);
          StringBuffer sTmp = new StringBuffer("file:///");
          sTmp.append(sourceFile.getCanonicalPath().replace('\\', '/'));
          sUrl = sTmp.toString();
      }   


I've no notion what "private:" may mean, so I ignored it. Then I used it as the first argument for loadComponentFromUrl. The remarkable thing is that when I created a URL object and used its toString() function as the first argument, the thing did not work, which prompted my original post.

So thank you, I did get what I needed.

Alex
http://www.cut-the-knot.org
Back to top
View user's profile Send private message Visit poster's website
SergeM
Super User
Super User


Joined: 09 Sep 2003
Posts: 3211
Location: Troyes France

PostPosted: Sun Jul 03, 2005 1:06 am    Post subject: Reply with quote

SDK is a good start : there is a lot of JAVA examples. The only problem : it miss a good documentation.
I have begun to introduce shematic diagram in my document to make easy to program with an other language than C++ ( I have in mind Java but I never write a line of Java code)
_________________
Linux & Windows OOo3.0
UNO & C++ : WIKI
http://wiki.services.openoffice.org/wiki/Using_Cpp_with_the_OOo_SDK
In French
http://wiki.services.openoffice.org/wiki/Documentation/FR/Cpp_Guide
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group