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

Help with Visual Basic (.net) code for saving a calc file

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


Joined: 24 May 2007
Posts: 6

PostPosted: Mon Jun 04, 2007 7:30 am    Post subject: Help with Visual Basic (.net) code for saving a calc file Reply with quote

Does anyone know the code to get a 'save as' dialogue to come up when automating 'Calc', using visual basic (.net) ? I've searched around and haven't found anything that works.

thanks!
Back to top
View user's profile Send private message
SergeM
Super User
Super User


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

PostPosted: Mon Jun 04, 2007 10:49 am    Post subject: Reply with quote

See :
how to launch 'save as ' dialog in OOo Macro ? http://www.oooforum.org/forum/viewtopic.phtml?t=12079&highlight=
for a start.
_________________
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
oonewb
General User
General User


Joined: 24 May 2007
Posts: 6

PostPosted: Mon Jun 04, 2007 3:28 pm    Post subject: Reply with quote

Well... I figured it out for myself again...This will bring up the 'save as' prompt. Here is the code: (again, this is written in VB .net with visual studio 2005)


document = oDoc.CurrentController.Frame
dispatcher = oSM.createInstance("com.sun.star.frame.DispatchHelper")
dispatcher.executeDispatch(document, ".uno:SaveAs", "", 0, aNoArgs)


This assumes that you 'dim'ed everything properly in vb .net. You can then use the following to save the file whenever you want: (ie. after you've updated cells)


oDoc.store()
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