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

Joined: 19 Apr 2005 Posts: 11
|
Posted: Tue May 10, 2005 12:00 am Post subject: using shell command in Openoffice version 1.1.4 |
|
|
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 |
|
 |
9point9 Moderator

Joined: 31 Aug 2004 Posts: 3875 Location: UK
|
Posted: Tue May 10, 2005 1:01 am Post subject: |
|
|
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 |
|
 |
ms159 General User

Joined: 19 Apr 2005 Posts: 11
|
Posted: Tue May 10, 2005 6:21 am Post subject: |
|
|
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 |
|
 |
ms159 General User

Joined: 19 Apr 2005 Posts: 11
|
Posted: Tue May 10, 2005 6:12 pm Post subject: |
|
|
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 |
|
 |
|