Forum at OOoForum.orgThe Forum
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

select different document in macro

Post new topic   Reply to topic Forum Index -> Macros and API
View previous topic :: View next topic  
Author Message

PostPosted: Wed Jun 25, 2003 4:31 pm    Post subject: select different document in macro Reply with quote

Hi, i use a macro to open a csv document and do some formatting for display
The thing is : how i do to close the original macro document ?
When i open the csv, it recieves the focus, so the original one loses it.
All i have to do is get the focus of it and close it, leaving the csv alone opened.
Have looked at the tutorial.pdf and still can´t figure out this.

Sub Main
Dim oDesktop, oDocument As Object
Dim sUrl As String
Dim mFileProperties(2) As New
dim document as object
dim dispatcher as object
dim oEl as object

sUrl = "file:///c|/listado.csv"
mFileProperties(0).Name = "FilterName"
mFileProperties(0).Value = "scalc: Text - txt - csv (StarCalc)"
mFileProperties(1).Name = "FilterFlags"
'mFileProperties(1).Value = "44/MRG,34,SYSTEM,1,1/4/2/1/4/2/5/2/7/4"
mFileProperties(1).Value = "44/MRG,34,,1,1/4/4/2/5/2/7/4"

oDesktop = createUNOservice("")
oDocument = oDesktop.loadComponentFromURL(sUrl,"_blank",0,mFileProperties())

' I should select and close the original doc here..
End Sub

Thanks in advance.
Back to top

Joined: 03 Mar 2003
Posts: 1605
Location: Wellington, New Zealand

PostPosted: Fri Jun 27, 2003 6:30 pm    Post subject: Reply with quote

I assume that your macro is in a document rather than [soffice].standard so you can reference it as 'thiscomponent' so
and your document (and macro) will disappear
Back to top
View user's profile Send private message

PostPosted: Sun Jun 29, 2003 9:03 pm    Post subject: Thanks !! Reply with quote

dfrench, that did it.
The doc with the macro is a csv viewer , the result of a process in one application
i´m doing in Clarion for Windows. I used before OOo, staroffice5.2 and excel.
This will be the replacement for both, definetly.
I´m trying to switch any client i have to OOo and i can say people is quite happy
with the results. Of course, some MS people don´t talk any good about me,
not to mention all Nt/2K servers replaced with samba, postfix, courier-imap, etc Very Happy
Hope move to java soon.

Best regards
Pablo Sánchez.
Montevideo, R.O de Uruguay.
Back to top
Display posts from previous:   
Post new topic   Reply to topic Forum Index -> 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