Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.clipper.visual-objects > #3908 > unrolled thread

VO to Vulcan

Started byJean-Pierre Maertens <jp.maertens@gmail.com>
First post2012-08-08 02:27 -0700
Last post2012-08-09 16:55 -0500
Articles 11 — 4 participants

Back to article view | Back to comp.lang.clipper.visual-objects


Contents

  VO to Vulcan Jean-Pierre Maertens <jp.maertens@gmail.com> - 2012-08-08 02:27 -0700
    Re: VO to Vulcan "Willie Moore" <williem@wmconsulting.com> - 2012-08-08 18:08 -0500
      Re: VO to Vulcan Jean-Pierre Maertens <jp.maertens@gmail.com> - 2012-08-09 00:57 -0700
    Re: VO to Vulcan Malcolm G <malcolm-news2012delete@delete.jobstream.com> - 2012-08-09 09:30 +0100
      Re: VO to Vulcan Jean-Pierre Maertens <jp.maertens@gmail.com> - 2012-08-09 02:20 -0700
        Re: VO to Vulcan Jean-Pierre Maertens <jp.maertens@gmail.com> - 2012-08-09 05:00 -0700
          Re: VO to Vulcan Malcolm G <malcolm-news2012delete@delete.jobstream.com> - 2012-08-09 13:22 +0100
        Re: VO to Vulcan Malcolm G <malcolm-news2012delete@delete.jobstream.com> - 2012-08-09 13:26 +0100
        Re: VO to Vulcan Willie Moore <williem@wmconsulting.com> - 2012-08-09 15:43 +0000
          Re: VO to Vulcan Malcolm G <malcolm-news2012delete@delete.jobstream.com> - 2012-08-09 17:50 +0100
    Re: VO to Vulcan "Willie Moore" <williem@wmconsulting.com> - 2012-08-09 16:55 -0500

#3908 — VO to Vulcan

FromJean-Pierre Maertens <jp.maertens@gmail.com>
Date2012-08-08 02:27 -0700
SubjectVO to Vulcan
Message-ID<63e92c70-5bae-4b33-bfe2-39ccde1e5a34@googlegroups.com>
Working to make MS-Word usable in vulcan I am trying to fix this problem :

oBookmarks:=Bookmarks:item(1)
or
oBookmarks:=Bookmarks:item[1]
or
oBookmarks:=Bookmarks[item,1]

All these syntaxes give a compiler error in Visual Studio
last 2 : no indexed property getter that accepts these argument types.

TIA

The first line : oBookmarks:=Bookmarks:item(1) works fine in VO

[toc] | [next] | [standalone]


#3914

From"Willie Moore" <williem@wmconsulting.com>
Date2012-08-08 18:08 -0500
Message-ID<jvuri5$15v$1@speranza.aioe.org>
In reply to#3908
Jean-Pierre,

Have you tried oBookmarks:=Bookmarks[1]? Remember that dotnet collections 
are all zero based.

Regards,
Willie
Vulcan VIP

"Jean-Pierre Maertens"  wrote in message 
news:63e92c70-5bae-4b33-bfe2-39ccde1e5a34@googlegroups.com...

Working to make MS-Word usable in vulcan I am trying to fix this problem :

oBookmarks:=Bookmarks:item(1)
or
oBookmarks:=Bookmarks:item[1]
or
oBookmarks:=Bookmarks[item,1]

All these syntaxes give a compiler error in Visual Studio
last 2 : no indexed property getter that accepts these argument types.

TIA

The first line : oBookmarks:=Bookmarks:item(1) works fine in VO 

[toc] | [prev] | [next] | [standalone]


#3917

FromJean-Pierre Maertens <jp.maertens@gmail.com>
Date2012-08-09 00:57 -0700
Message-ID<085e8c00-c231-4e7b-937f-4ef345d24b9a@googlegroups.com>
In reply to#3914
Willy,

I tried everything. what you type is the same as
 oBookmarks:=Bookmarks:item[1]
because "item" is the default method in that class, and so it gives the same compiler errors.

In the end I got this to compile : 
 
    LOCAL oEnum as IEnumerator

    oEnum:=oBookMarks:GetEnumerator() 
    oBookMark:= (bookmark) oenum:Current

This is not the way I want to work because I used to be able to address any bookmark in the order I wanted, but the enumerator has only "next" as a method... 

Still, I do not know if this even works, because the next problem is opening a Word-file in Vulcan...  that will be my next thread.

Something that used to be simple in VO like oDocument:=odocuments:Open("myfile.docx")
does NOT work anymore.  The compiler wants a "Filename REF OBJECT", and I have no clue how to make this work (no help in the Vulcan docs whatsoever, I would think many people are using Word or Excel in their software ?)

greetings
JP


Op donderdag 9 augustus 2012 01:08:54 UTC+2 schreef Willie Moore het volgende:
> Jean-Pierre,
> 
> 
> 
> Have you tried oBookmarks:=Bookmarks[1]? Remember that dotnet collections 
> 
> are all zero based.
> 
> 
> 
> Regards,
> 
> Willie
> 
> Vulcan VIP
> 

[toc] | [prev] | [next] | [standalone]


#3918

FromMalcolm G <malcolm-news2012delete@delete.jobstream.com>
Date2012-08-09 09:30 +0100
Message-ID<3zKUr.725135$1o5.711475@fx03.am4>
In reply to#3908
On 08/08/2012 10:27, Jean-Pierre Maertens wrote:
> Working to make MS-Word usable in vulcan I am trying to fix this problem :
> 
> oBookmarks:=Bookmarks:item(1)
> or
> oBookmarks:=Bookmarks:item[1]
> or
> oBookmarks:=Bookmarks[item,1]
> 
> All these syntaxes give a compiler error in Visual Studio
> last 2 : no indexed property getter that accepts these argument types.
> 
> TIA
> 
> The first line : oBookmarks:=Bookmarks:item(1) works fine in VO

What have you declared the type of Bookmarks ?

Similarly with your follow up of oDocuments. However in that case surely
if something wants a reference to an object you give it a reference to
variable typed as object, with the contents you want
(you can write cString:= (string)oTempObject to get it back into a string)




[toc] | [prev] | [next] | [standalone]


#3919

FromJean-Pierre Maertens <jp.maertens@gmail.com>
Date2012-08-09 02:20 -0700
Message-ID<61eedd4b-9584-45f4-a63d-4bf5c60d2705@googlegroups.com>
In reply to#3918
Malcolm,

this is the code where I try to open a file :

    LOCAL oapplication AS Applicationclass
    LOCAL oDocuments AS Documents
    LOCAL oDocument AS DocumentClass
    LOCAL ofileName as object
 
    oapplication:=Applicationclass{}
    oapplication:Visible:=TRUE
    oDocuments:=oapplication:Documents
    oFileName := (object) "C:\Users\jpmaertens\Documents\test.docx" 
    oDocument:=oDocuments:Open(ofileName)  /
ERROR : Microsoft.Office.Interop.Word.Documents.Open( OBJECT )' : no overload that accepts these argument types   


this is the code where I want to use the bookmarks, of a document that is not open yet :-)

METHOD vulin() as void
    LOCAL oBookMarks AS Bookmarks
    LOCAL oBookMark AS Bookmark
    LOCAL naantal AS int
    LOCAL x,y AS int
    LOCAL cNaam,cTerug AS STRING
    LOCAL oRange AS range
    LOCAL oEnum as IEnumerator
    
    
    oBookMarks:=SELF:Bookmarks  // subclass of Documentclass so self=document

    oEnum:=oBookMarks:GetEnumerator() 
    nAantal:=oBookMarks:Count
    y:=1
    FOR x:=1 UPTO naantal
        
        oBookMark:= (bookmark) oenum:Current
        
        /*oBookMark:= oBookMarks:Item(1) //does NOT work */
        cNaam:=oBookmark:Name

  ...... and so on









> 
> What have you declared the type of Bookmarks ?
> 
> 
> 
> Similarly with your follow up of oDocuments. However in that case surely
> 
> if something wants a reference to an object you give it a reference to
> 
> variable typed as object, with the contents you want
> 
> (you can write cString:= (string)oTempObject to get it back into a string)

[toc] | [prev] | [next] | [standalone]


#3921

FromJean-Pierre Maertens <jp.maertens@gmail.com>
Date2012-08-09 05:00 -0700
Message-ID<2235ba63-430e-4bf3-b38a-b8ab06fd2407@googlegroups.com>
In reply to#3919
And in case you wonder 

oFileName := (OBJECT) "C:\Users\jpmaertens\Documents\test.docx"
oDocument:=oDocuments:Open(@oFilename )


error :
'Microsoft.Office.Interop.Word.Documents.Open( OBJECT PTR )' : no overload that accepts these argument types

[toc] | [prev] | [next] | [standalone]


#3922

FromMalcolm G <malcolm-news2012delete@delete.jobstream.com>
Date2012-08-09 13:22 +0100
Message-ID<cYNUr.478444$ma6.279471@fx09.am4>
In reply to#3921
On 09/08/2012 13:00, Jean-Pierre Maertens wrote:
> And in case you wonder 
> 
> oFileName := (OBJECT) "C:\Users\jpmaertens\Documents\test.docx"
> oDocument:=oDocuments:Open(@oFilename )
> 
> 
> error :
> 'Microsoft.Office.Interop.Word.Documents.Open( OBJECT PTR )' : no overload that accepts these argument types

Sorry that sample does not compile for me.

[toc] | [prev] | [next] | [standalone]


#3923

FromMalcolm G <malcolm-news2012delete@delete.jobstream.com>
Date2012-08-09 13:26 +0100
Message-ID<V%NUr.478445$ma6.10620@fx09.am4>
In reply to#3919
On 09/08/2012 10:20, Jean-Pierre Maertens wrote:
> Malcolm,
> 
> this is the code where I try to open a file :
> 
>     LOCAL oapplication AS Applicationclass
>     LOCAL oDocuments AS Documents
>     LOCAL oDocument AS DocumentClass
>     LOCAL ofileName as object
>  
>     oapplication:=Applicationclass{}
>     oapplication:Visible:=TRUE
>     oDocuments:=oapplication:Documents
>     oFileName := (object) "C:\Users\jpmaertens\Documents\test.docx" 
>     oDocument:=oDocuments:Open(ofileName)  /
> ERROR : Microsoft.Office.Interop.Word.Documents.Open( OBJECT )' : no overload that accepts these argument types   

Ok (I am still not sure of the exact types as you have ommited the
refences and using parts, also that does not specify what compiler
options you are using - i tend to use the VO compabile casts and
conversions)

Can I confirm that is a compile time error?


[toc] | [prev] | [next] | [standalone]


#3924

FromWillie Moore <williem@wmconsulting.com>
Date2012-08-09 15:43 +0000
Message-ID<907979241366219281.938320williem-wmconsulting.com@news.aioe.org>
In reply to#3919
Jean-Pierre,

Apparently the automation doesn't like for you to access the bookmark
directly by The number (iBookmarks[1] ) even though MSDN says you can.  you
can use a foreach loop

Your open will work once you add all of the parameters. There are 16
type.missings that you have to put in. Vb and VO hides the missings. C# and
Vulcan do not. 

Regards,
Willie

Jean-Pierre Maertens <jp.maertens@gmail.com> wrote:
> Malcolm,
> 
> this is the code where I try to open a file :
> 
>     LOCAL oapplication AS Applicationclass
>     LOCAL oDocuments AS Documents
>     LOCAL oDocument AS DocumentClass
>     LOCAL ofileName as object
>  
>     oapplication:=Applicationclass{}
>     oapplication:Visible:=TRUE
>     oDocuments:=oapplication:Documents
>     oFileName := (object) "C:\Users\jpmaertens\Documents\test.docx" 
>     oDocument:=oDocuments:Open(ofileName)  /
> ERROR : Microsoft.Office.Interop.Word.Documents.Open( OBJECT )' : no
> overload that accepts these argument types   
> 
> 
> this is the code where I want to use the bookmarks, of a document that is not open yet :-)
> 
> METHOD vulin() as void
>     LOCAL oBookMarks AS Bookmarks
>     LOCAL oBookMark AS Bookmark
>     LOCAL naantal AS int
>     LOCAL x,y AS int
>     LOCAL cNaam,cTerug AS STRING
>     LOCAL oRange AS range
>     LOCAL oEnum as IEnumerator
>     
>     
>     oBookMarks:=SELF:Bookmarks  // subclass of Documentclass so self=document
> 
>     oEnum:=oBookMarks:GetEnumerator() 
>     nAantal:=oBookMarks:Count
>     y:=1
>     FOR x:=1 UPTO naantal
>         
>         oBookMark:= (bookmark) oenum:Current
>         
>         /*oBookMark:= oBookMarks:Item(1) //does NOT work */
>         cNaam:=oBookmark:Name
> 
>   ...... and so on
> 
> 
> 
> 
> 
> 
> 
> 
> 
>> 
>> What have you declared the type of Bookmarks ?
>> 
>> 
>> 
>> Similarly with your follow up of oDocuments. However in that case surely
>> 
>> if something wants a reference to an object you give it a reference to
>> 
>> variable typed as object, with the contents you want
>> 
>> (you can write cString:= (string)oTempObject to get it back into a string)

[toc] | [prev] | [next] | [standalone]


#3925

FromMalcolm G <malcolm-news2012delete@delete.jobstream.com>
Date2012-08-09 17:50 +0100
Message-ID<tTRUr.1178160$%k.856793@fx20.am4>
In reply to#3924
On 09/08/2012 16:43, Willie Moore wrote:
> Jean-Pierre,
> 
> Apparently the automation doesn't like for you to access the bookmark
> directly by The number (iBookmarks[1] ) even though MSDN says you can.  you
> can use a foreach loop
> 
> Your open will work once you add all of the parameters. There are 16
> type.missings that you have to put in. Vb and VO hides the missings. C# and
> Vulcan do not. 

Ahh (using oleautoobject in vulcan here at jobstream and that copes with
trailing missing params)

[toc] | [prev] | [next] | [standalone]


#3926

From"Willie Moore" <williem@wmconsulting.com>
Date2012-08-09 16:55 -0500
Message-ID<k01bks$4d9$1@speranza.aioe.org>
In reply to#3908
Jean-Pierre,

Here is example code the opens a word document and access a bookmark.

Regards,
Willie
Vulcan VIP

PRIVATE METHOD button1_Click( sender AS System.OBJECT, e AS 
System.EventArgs ) AS System.VOID
    LOCAL objWord     AS Microsoft.Office.Interop.Word.Application
    LOCAL objDocument AS Microsoft.Office.Interop.Word.Document
    LOCAL oBookMarks  AS Microsoft.Office.Interop.Word.Bookmarks
    LOCAL oBookMark   AS Microsoft.Office.Interop.Word.Bookmark
    LOCAL cFile       AS OBJECT
    LOCAL oMissing    AS OBJECT
    LOCAL nCount      AS LONG
    LOCAL nIndex AS OBJECT
    TRY
        cFile       := "c:\vodc10\rightSLE in a dotNet Environment.doc"
        oMissing    := Type.Missing
        objWord     := Microsoft.Office.Interop.Word.Application{}
        objDocument := objWord:Documents:Open(cFile, oMissing, 
oMissing,oMissing,oMissing,oMissing,oMissing,oMissing,;
                       oMissing,oMissing,oMissing,oMissing,oMissing,oMissing,oMissing,oMissing)

        // see what bookmarks we might have
        oBookMarks  := objDocument:BookMarks
        nCount      := oBookMarks:Count
        IF nCount > 0
            nIndex := 0
            oBookMark := (bookmark)oBookMarks[nIndex]
        ENDIF
        objDocument:Activate()
        objWord:Visible := TRUE
    CATCH ex AS Exception
        MessageBox.Show(ex:ToString())
    END TRY

    RETURN




"Jean-Pierre Maertens"  wrote in message 
news:63e92c70-5bae-4b33-bfe2-39ccde1e5a34@googlegroups.com...

Working to make MS-Word usable in vulcan I am trying to fix this problem :

oBookmarks:=Bookmarks:item(1)
or
oBookmarks:=Bookmarks:item[1]
or
oBookmarks:=Bookmarks[item,1]

All these syntaxes give a compiler error in Visual Studio
last 2 : no indexed property getter that accepts these argument types.

TIA

The first line : oBookmarks:=Bookmarks:item(1) works fine in VO 

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.clipper.visual-objects


csiph-web