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

[Solved] How to save and close embedded OpenOffice document?

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


Joined: 29 Oct 2008
Posts: 3

PostPosted: Wed Oct 29, 2008 6:15 am    Post subject: [Solved] How to save and close embedded OpenOffice document? Reply with quote

I have calc spreadsheet embedded on CAD-file that I want to open, save and close. Opening is not big problem but if I want to save and close this embedded calc file, I have problems.

If this file is manually opened from CAD then OpenOffice calc File-menu contains buttons "Update somefilename.XXX" and "Close & Return to somefilename.XXX" and not the normal "Save" and "Close". I think I should use some other commands to close and save in this case than:

Code:
doc.store()
 doc.close(True)


So is there methods to get this work?


Last edited by sniveri on Wed Nov 05, 2008 3:38 am; edited 1 time in total
Back to top
View user's profile Send private message
probe1
Moderator
Moderator


Joined: 18 Aug 2004
Posts: 2560
Location: Chonburi Thailand Asia

PostPosted: Wed Oct 29, 2008 7:58 am    Post subject: Reply with quote

Welcome to the forum.

Have you tried inspecting the object you load with XRay?
Of course, you can post your solution, if you find out yourself. Smile


Next time, please quote your system's details (OOo version, operating system, doc types used, ...) with such questions - it might be decisive. Thanks.
_________________
Cheers
Winfried
My Macros
DateTime2 extension: insert date, time or timestamp, formatted to your needs
Back to top
View user's profile Send private message Visit poster's website
sniveri
Newbie
Newbie


Joined: 29 Oct 2008
Posts: 3

PostPosted: Wed Oct 29, 2008 10:30 am    Post subject: Reply with quote

I have not used XRay, thanks for the tip.

I`m using Windows XP, VB .net, OpenOffice 3.0 and that calc file is in .ods format. CAD that I use is SolidWorks and there is possible to add files as "attachments" directly to the CAD-file. If you open this attachment-file from SolidWorks it opens to the default program for that filetype. It is almost same as adding an OLEobject but still slightly different.
Back to top
View user's profile Send private message
sniveri
Newbie
Newbie


Joined: 29 Oct 2008
Posts: 3

PostPosted: Fri Oct 31, 2008 9:53 am    Post subject: Reply with quote

ok, that spreadsheet is saved automatically when window is closed. So only problem is that I can not use doc.close but maybe WM_CLOSE will solve this problem.

But how I can find current document window handle for sending WM_CLOSE?

EDIT: I suppose that there is no API for getting handles so I used basic FindWindow for searching correct window and got this to work.
Back to top
View user's profile Send private message
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