Writting at end of Document in Visual Basic

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Writting at end of Document in Visual Basic

Albert Mateu
This is a part of my Visual Basic code, ( i 've to use them :P but now whith Open office  == :))

       Set OpenPar(0) = MakePropertyValue("ReadOnly", False)
       Set OpenPar(1) = MakePropertyValue("Hidden", False)
       Set oDoc = oDesk.loadComponentFromURL(ConvertToUrl(YourPathFile), "_blank", 0, OpenPar()) 'can be a Ms Word, Open office , etc

     Set objText = oDoc.GetText
     Set objCursor = objText.createTextCursor
    objCursor.collapseToEnd 'its important to move the cursor to end, i don't know why

    'Create a paragraph break
    'The second argument is a com::sun::star::text::ControlCharacter::PARAGRAPH_BREAK constant
    Call objText.insertControlCharacter(objCursor, 0, False)
    'insert text at the end of the document
    Call objText.insertString(objCursor, insertText & vbLf, False)