| View previous topic :: View next topic |
| Author |
Message |
oonewb General User

Joined: 24 May 2007 Posts: 6
|
Posted: Mon Jun 04, 2007 7:30 am Post subject: Help with Visual Basic (.net) code for saving a calc file |
|
|
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 |
|
 |
SergeM Super User

Joined: 09 Sep 2003 Posts: 3211 Location: Troyes France
|
|
| Back to top |
|
 |
oonewb General User

Joined: 24 May 2007 Posts: 6
|
Posted: Mon Jun 04, 2007 3:28 pm Post subject: |
|
|
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 |
|
 |
|