| View previous topic :: View next topic |
| Author |
Message |
sniveri Newbie

Joined: 29 Oct 2008 Posts: 3
|
Posted: Wed Oct 29, 2008 6:15 am Post subject: [Solved] How to save and close embedded OpenOffice document? |
|
|
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 |
|
 |
probe1 Moderator


Joined: 18 Aug 2004 Posts: 2465 Location: Chonburi Thailand Asia
|
Posted: Wed Oct 29, 2008 7:58 am Post subject: |
|
|
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.
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 |
|
 |
sniveri Newbie

Joined: 29 Oct 2008 Posts: 3
|
Posted: Wed Oct 29, 2008 10:30 am Post subject: |
|
|
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 |
|
 |
sniveri Newbie

Joined: 29 Oct 2008 Posts: 3
|
Posted: Fri Oct 31, 2008 9:53 am Post subject: |
|
|
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 |
|
 |
|