I am back answering my own problem (after much time).
I found the function ?typename( ) most useful in determining the class of the entity placed insided the parens. This is an immediate window feature.
Most of the issues I have found with the errors are "data mismatch" and the typename function helps determine what kind of entity you are dealing with. Combining the information from the Object Browser (F2 key) helps determine what type of entity each method is looking for.
Looking at my current code, it is successfully working the theHyperlinkTextSources instead of the HyperlinkPageItemSources method.
In this example a graphic has been inserted into a text frame object, and the link is to appear on the graphic.
oTextframe.InsertionPoints.LastItem.Place (sImage & ".tif")
Set oHyperlinkTextSource = oDocument.HyperlinkTextSources.Add(oTextframe.Texts.FirstItem)
The key thing is supplying the correct data type to satisfy the method.
Well, nice idea but not a solution.
I got the same problem with VB and CS5. I try to do something like that:
Dim mInDesign As InDesign.Application
Dim mPub As InDesign.Document
Dim mHyperlink As InDesign.Hyperlink
Set mInDesign = GetObject("", "InDesign.Application.CS5")
Set mPub = mInDesign.Documents.Item(1)
Dim mRectangle as InDesign.Rectangle
'REM - rectangleID is a Long parameter for this function and is a valid rectangle ID
Dim mHysperSource As InDesign.HyperlinkPageItemSource
Set mHysperSource = mPub.HyperlinkPageItemSources.Add(mRectangle)
Dim mDestination As InDesign.HyperlinkURLDestination
Set mDestination = mPub.HyperlinkURLDestinations.Add(mDocObj.rs.fields(mQuellDBField).Value)
Set mHyperlink = mPub.Hyperlinks.Add(mHysperSource, mDocObj.rs.fields(mQuellDBField))
mHyperlink.Visible = True
Well, the bold underlined line of code creates error 13 - type mismatch!
No mather what I am trying to use mRectangle.AllPageItems.Item(1), mRectangle.PageItems.Item(1), mRectangle.AllGraphics.Item(1) - still no success
Watching the variable shows mRectangle as Variant/Object/Rectange and mRectangle.AllGraphics.Item(1) as Variant/Object/Image
The Image is a JPEG Image....
Any suggestions how to get Hyperlinks working with Rectnagle? (I cannot use TextFrame with InsertionPoint... it is Rectangle and I cannot change it)