I am trying to insert an image within a frame. This image is a picture of a signature. A specific text is placed in the frame where the signature will placed.
This is the VB Code:
Code: Select all
Set oSearchDesc = oStarOfficeDoc.createSearchDescriptor
oSearchDesc.SearchString = sSignHere <--This is the text that is located in the frame
oSearchDesc.SearchWords = True
Set oFound = oStarOfficeDoc.findFirst(oSearchDesc)
Set oText = oStarOfficeDoc.GetText()
//Setup the image for processing later
Set oGraphicObject = oStarOfficeDoc.createInstance("com.sun.star.text.GraphicObject")
sGraphicUrl = ConvertToUrl(sGraphicUrl)
oGraphicObject.GraphicURL = sGraphicUrl
oGraphicObject.Width = 6000
oGraphicObject.Height = 2500
oGraphicObject.AnchorType = 1
Set oCursor = oText.createTextCursorByRange(oFound) <--I am getting a error at this line -->com.sun.star.uno.RuntimeException
Call oText.insertTextContent(oCursor, oGraphicObject, False)
Regards,
Will