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

CreateObject for groupwise

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





PostPosted: Tue Jun 29, 2004 2:53 pm    Post subject: CreateObject for groupwise Reply with quote

I have VB code that opens up a groupwise account and retrieves info for me

Code:

Sub GW_WhoAmI(ByRef MyName As String, ByRef MyAddr As String, ByRef MyPhone As String, ByRef MyFAX As String)
Dim gw As Object
Dim Myself As Object
Dim Mee As String
Dim GWFieldName As String
Dim CBM As String
Dim gwField As Variant
Dim eMail As String
Dim phone As String
Dim fax As String
Dim PhoneObj As Object

    Set gw = CreateObject("NovellGroupWareSession")
    On Error Resume Next
    gw.login
    If Err.Number <> 0 Then
        Exit Sub
    Else
        MyAddr = gw.rootaccount.owner.EMailAddress
        MyName = gw.rootaccount.owner.DisplayName

        Set Myself = gw.rootaccount.SystemAddressBook.AddressBookEntries.Find("(<E-Mail Address> MATCHES """ + MyAddr + """)")
        For Each gwField In Myself.Item(1).Fields
            GWFieldName = gwField.name
            If GWFieldName = "Office Phone Number" Then
                MyPhone = gwField.Value
            End If
            If GWFieldName = "Fax Number" Then
                MyFAX = gwField.Value
            End If
        Next
    End If
   
Set Myself = Nothing
Set gw = Nothing
End Sub


It's not a typical sun.com.... object and I can't work with it.

when I try to xray it it says
Quote:

[Automation Bridge] Automation object does not provide type information.


If possible, how can I use this object, what code do I need to change?
Back to top
Cybb20
Super User
Super User


Joined: 02 Mar 2004
Posts: 1569
Location: Frankfurt, Germany

PostPosted: Tue Jun 29, 2004 4:42 pm    Post subject: Reply with quote

First of all: Which program are you using here with your VB code?
Secondly: If you don't say on which object you did xray noone can know the answer
Thirdly: I am confused Sad

Sorry to give you no real answer, but I guess I am not the only one that reads your post and does not know what you exactly did and what this has got to do with OpenOffice.

Please make absolutely clear what you're using and what your problem is.

Christian
_________________
- Knowledge is Power -
Back to top
View user's profile Send private message Send e-mail
pitonyak
Administrator
Administrator


Joined: 09 Mar 2004
Posts: 3655
Location: Columbus, Ohio, USA

PostPosted: Tue Jun 29, 2004 6:47 pm    Post subject: Reply with quote

I think that you need documentation on the group wise object... I found numerous links after checking google, but no tutorials or anything.
_________________
--
Andrew Pitonyak
http://www.pitonyak.org/oo.php
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address
WatchyPerry
Guest





PostPosted: Wed Jun 30, 2004 7:14 am    Post subject: CreateObject for groupwise Reply with quote

Sorry about the lack of details...

The above code is currently used in a Microsoft Word document to open a Novell Groupwise (Email) address book, extract information (name, email, phone) and save those to variables.

I want to do the same thing in Openoffice... I want to be able to access the Groupwise object but don't know exactly how to do it with OOo code. The above code works in VB and not in OOo Basic, aside from some of syntax which I know I have to change, I want to know how OOo Basic accesses other programs object.

Question
Back to top
Cybb20
Super User
Super User


Joined: 02 Mar 2004
Posts: 1569
Location: Frankfurt, Germany

PostPosted: Wed Jun 30, 2004 8:32 am    Post subject: Reply with quote

Ah now I get it..
Quote:

Code:

Set gw = CreateObject("NovellGroupWareSession")

In OpenOffice you access a COM/OLE object with the following piece of code:
Code:

Dim oleService, groupwiseapp
oleService = createUnoService("com.sun.star.bridge.OleObjectFactory")
groupwiseapp = oleService.createInstance("NovellGroupWareSession")

If you're familiar with Starbasic you should be able to easily translate the code that follows, if not please reply to this post and me or others will translate your whole code.

Hope that helps.
Christian
_________________
- Knowledge is Power -
Back to top
View user's profile Send private message Send e-mail
DannyB
Moderator
Moderator


Joined: 02 Apr 2003
Posts: 3991
Location: Lawrence, Kansas, USA

PostPosted: Wed Jun 30, 2004 8:47 am    Post subject: Reply with quote

I think Cybb20 shows a very concise translation from Word's "CreateObject" to the OOo counterpart. (Would be even more concise without a Dim statement.)

Recently, I've heard tales of some documentation that would tell people how to translate macro code from MS Office to OOo. Shouldn't this be added to that documentation?
_________________
Want to make OOo Drawings like the colored flower design to the left?
Back to top
View user's profile Send private message
WatchyPerry
Guest





PostPosted: Wed Jun 30, 2004 9:05 am    Post subject: CreateObject for groupwise Reply with quote

Thank you for the reply, that helps.

I still get the message

Quote:

[Automation Bridge] Automation object does not provide type information.


When I run the code:

Code:

Sub Main
call GW_WhoAmI(MyName, MyAddr, MyPhone, MyFAX)
End Sub


Sub GW_WhoAmI(ByRef MyName As String, ByRef MyAddr As String, ByRef MyPhone As String, ByRef MyFAX As String)
Dim gw As Object
Dim Myself As Object
Dim Mee As String
Dim GWFieldName As String
Dim CBM As String
Dim gwField As Variant
Dim eMail As String
Dim phone As String
Dim fax As String
Dim PhoneObj As Object
Dim oleService, groupwiseapp

'this is the newly added code from the above post
oleService = createUnoService("com.sun.star.bridge.OleObjectFactory")
gw = oleService.createInstance("NovellGroupWareSession")
    'Set gw = CreateObject("NovellGroupWareSession") 'this is what I was doing

    gw.login         '<----******this is where the error shows up       *********
MyAddr = gw.rootaccount.owner.EMailAddress
        MyName = gw.rootaccount.owner.DisplayName

        Set Myself = gw.rootaccount.SystemAddressBook.AddressBookEntries.Find("(<E-Mail Address> MATCHES """ + MyAddr + """)")
            GWFieldName = gwField.name
            If GWFieldName = "Office Phone Number" Then
                MyPhone = gwField.Value
            End If
            If GWFieldName = "Fax Number" Then
                MyFAX = gwField.Value
            End If
Set Myself = Nothing
Set gw = Nothing
End Sub



What am I doing wrong Question
Back to top
Cybb20
Super User
Super User


Joined: 02 Mar 2004
Posts: 1569
Location: Frankfurt, Germany

PostPosted: Wed Jun 30, 2004 10:24 am    Post subject: Reply with quote

This has probably nothing to do with OOoBasic.
It has mainly got to do with the "GroupwareSession" program and how types are mapped, how interfaces are taken over etc. etc.
So I guess you have to dig into GroupwareSession documentation, and if they don't provide you information about OLE Automation or COM then you can only try to get information out of the source code of the GroupwareSession program, I guess.
_________________
- Knowledge is Power -
Back to top
View user's profile Send private message Send e-mail
DannyB
Moderator
Moderator


Joined: 02 Apr 2003
Posts: 3991
Location: Lawrence, Kansas, USA

PostPosted: Wed Jun 30, 2004 10:32 am    Post subject: Re: CreateObject for groupwise Reply with quote

WatchyPerry wrote:

[Automation Bridge] Automation object does not provide type information.


I suspect that means exactly what it says.

I suspect that UNO has no type information about the "gw" variable. Therefore, is "gw.login" a property? Is it a method? If a method, then what does it return? What are its parameters? Etc. The COM object is not providing type information, so the bridge is complaining.

I suspect that if you check the developer's guide, section about the Automation bridge, this limitation (and other useful information) may be documented.
_________________
Want to make OOo Drawings like the colored flower design to the left?
Back to top
View user's profile Send private message
Cybb20
Super User
Super User


Joined: 02 Mar 2004
Posts: 1569
Location: Frankfurt, Germany

PostPosted: Wed Jun 30, 2004 12:05 pm    Post subject: Reply with quote

To DannyB:
The problem here is that the Developer's Guide mainly discusses the mapping for COM -> UNO and not for UNO -> COM (what he's trying to do).
I would say it's mostly the part of the Groupware program how commands are passed etc. etc. (lots of things are in involved in something like that).
An excellent documentation about this would give you the udk projectsite:
http://udk.openoffice.org/common/man/draft/com_lang_spec.html

But again this is only the one side of it, the other side is how Groupware Session makes use of COM, how does it take commands from outside, how does it translate them.
I guess that Groupware also has an Automation interface that acts like a glue area between the program itself and COM.
Get information out of this, and you will very likely solve your problem when you follow those resources (feel free to share the relevant documents you have about Groupware and me or others can take a look at them - but don't just post them with no comment please, you should at least have read those and ask specific things about it before you post it to here).

I really hope that your problem will be solved, and I hope that it's not getting into the Windows COM low-level structure, which as I earlier mentioned is one of the most complex things of the Win32 API.
_________________
- Knowledge is Power -
Back to top
View user's profile Send private message Send e-mail
WatchyPerry
Guest





PostPosted: Wed Jun 30, 2004 12:23 pm    Post subject: CreateObject for groupwise Reply with quote

After looking into the Groupwise Developers guide... .login is a function of the application class of the library.

Quote:
GroupwareTypeLibrary.Application


Dannyb said:
Quote:

The COM object is not providing type information, so the bridge is complaining


That looks to be right on.

The developers guide suggest loading the library before doing any work which happens to be a gwab1.ocx file.

If I am correct I need to load this library to make my code work work Question

Now my question is how I can load this library (if that is what I need) Question
Back to top
WatchyPerry
Guest





PostPosted: Wed Jun 30, 2004 1:06 pm    Post subject: CreateObject for groupwise Reply with quote

A little more information.

.Login is a function that opens a specific groupwise account for individual access to information.
Back to top
DannyB
Moderator
Moderator


Joined: 02 Apr 2003
Posts: 3991
Location: Lawrence, Kansas, USA

PostPosted: Wed Jun 30, 2004 1:32 pm    Post subject: Reply with quote

Cybb20 wrote:
The problem here is that the Developer's Guide mainly discusses the mapping for COM -> UNO and not for UNO -> COM (what he's trying to do).


You are correct. I was thinking COM -> UNO when I wrote that.
_________________
Want to make OOo Drawings like the colored flower design to the left?
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