Date: prev next · Thread: first prev next last
2018 Archives by date, by thread · List index


Hi

I use the following code to open a spreadsheet and insert a logo and then
save the document via automation from VFP.  However if I use the Store()
method the logo is no included.  The 6 lines I inserted are included but not
the logo.  If I use the storeAsURL() then the logo is also included.  Is
this a bug or is there some feature I do not know that causes this
discrepancy?

Thanks
Simon

Local laArgs(1),loDisp,loSheet,loFrame,lo,lc

*
* This section just deletes any lock file because I have found that lock
files are sometimes not deleted and then 
* prevent subsequent access to the file.  
*
DECLARE LONG SetFileAttributes IN WIN32API String, Long
DECLARE LONG DeleteFile IN Win32API STRING

If
File(JustPath(toParam.Destination)+"\.~lock."+JustFname(toParam.Destination)+"#",1)
  
SetFileAttributes(JustPath(toParam.Destination)+"\.~lock."+JustFname(toParam.Destination)+"#",0)
  
DeleteFile(JustPath(toParam.Destination)+"\.~lock."+JustFname(toParam.Destination)+"#")
EndIf
If File("DOC\.~lock.AFDHEADERLOGO.PNG#",1)
   SetFileAttributes("DOC\.~lock.AFDHEADERLOGO.PNG#",0)
   DeleteFile("DOC\.~lock.AFDHEADERLOGO.PNG#")
EndIf
Clear Dlls "SetFileAttributes","DeleteFile"

Dimension laArgs(2)
toBizObj.MergeSetup("OOC")
toBizObj.MergeOpenDoc(toParam.Destination)
loSheet=toBizObj.oMergeDoc.getSheets().getByIndex(0)
loSheet.Rows.insertByIndex(0,6)
loFrame=toBizObj.oMergeDoc.getCurrentController().getFrame()
loDisp=toBizObj.oMergeSrvMgr.createInstance("com.sun.star.frame.DispatchHelper")

laArgs(1)=toBizObj.oMergeSrvMgr.Bridge_GetStruct("com.sun.star.beans.PropertyValue")
laArgs(1).Name="FileName"
laArgs(1).Value=ConvertToURL("D:\KARDTECH\CUSTOMERS\ALBERTAFUELDIST\KARDPOLL\DOC\AFDHEADERLOGO.PNG")
laArgs(2)=toBizObj.oMergeSrvMgr.Bridge_GetStruct("com.sun.star.beans.PropertyValue")
laArgs(2).Name="AsLink"
laArgs(2).Value=.F.
ComArray(loDisp,10)

loDisp.executeDispatch(loFrame, ".uno:InsertGraphic", "", 0, @laArgs)

laArgs(1).Name="FilterName"
laArgs(1).Value="MS Excel 97"
laArgs(2).Name="Overwrite"
laArgs(2).Value=.T.
ComArray(toBizObj.oMergeDoc,10)

*toBizObj.oMergeDoc.getCurrentController().getFrame().getContainerWindow().setVisible(.T.)
&& View SpreadSheet


toBizObj.oMergeDoc.storeAsURL(ConvertToURL(toParam.Destination),@laArgs)
*toBizObj.oMergeDoc.store()

Try
   toBizObj.oMergeDoc.close(1)
Catch
EndTry
toBizObj.oMerge.Terminate()



--
Sent from: http://document-foundation-mail-archive.969070.n3.nabble.com/Users-f1639498.html

-- 
To unsubscribe e-mail to: users+unsubscribe@global.libreoffice.org
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.