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

using shell command in Openoffice version 1.1.4

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


Joined: 19 Apr 2005
Posts: 11

PostPosted: Tue May 10, 2005 12:00 am    Post subject: using shell command in Openoffice version 1.1.4 Reply with quote

Hi,

I've used the same command in version 2, and it works fine (thanks to Danny B for the tip!)

But when I transport the macro to version 1.1.4 (with patch), running the same shell commands gives an error that "Basic runtime error - File not found".

Any idea why? is it a bug?

Thanks....
Back to top
View user's profile Send private message
9point9
Moderator
Moderator


Joined: 31 Aug 2004
Posts: 3875
Location: UK

PostPosted: Tue May 10, 2005 1:01 am    Post subject: Reply with quote

That doesn't sound like an error with shell. Would have to see all of your code.
_________________
Arch Linux
OOo 3.2.0

OOoSVN, change control for OOo documents:
http://sourceforge.net/projects/ooosvn/
Back to top
View user's profile Send private message Visit poster's website
ms159
General User
General User


Joined: 19 Apr 2005
Posts: 11

PostPosted: Tue May 10, 2005 6:21 am    Post subject: Reply with quote

HI, this is the code in the macro

sub TestMacro
rem ----------------------------------------------------------------------
rem define variables
dim document as object
dim dispatcher as object

dim oDoc
dim sDocURL
dim FileName as string

dim oFrame
dim newDoc
dim mArgs(0) as New com.sun.star.beans.PropertyValue
dim nArgs(0) as New com.sun.star.beans.PropertyValue
rem ----------------------------------------------------------------------
rem get access to the document
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")

rem ----------------------------------------------------------------------

'get the current document filename
oDoc = ThisComponent
if (Not GlobalScope.BasicLibraries.isLibraryLoaded("Tools")) then
GlobalScope.BasicLibraries.isLibraryLoaded("Tools")
End if

If (oDoc.hasLocation()) then
sDocURL = oDoc.getURL()
FileName = ConvertFromURL (sDocURL)
end if

oFrame = ThisComponent.getCurrentController().getFrame()
newDoc = oFrame.LoadComponentFromURL("private:factory/swriter", "", 2, mArgs())

Shell("C:\TestProject.exe",0,FileName)

ThisComponent.setModified(False)
newDoc.close(true)

end sub

"C:\TestProject.exe" is a test code written in VB6. The same code works in version2. but dosen't work in version1.1.4.

Any ideas?

Thanks very much.... ;)
Back to top
View user's profile Send private message
ms159
General User
General User


Joined: 19 Apr 2005
Posts: 11

PostPosted: Tue May 10, 2005 6:12 pm    Post subject: Reply with quote

Hi,

realise it's my own mistake.....

realise that shell command in 1.1.4 must not have any spaces in the file location...

Thanks....
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