Faceți căutări pe acest blog

luni, 19 martie 2018

AppendFromXlsx 3.1

A minor change (moved a line of code three lines upward), but with major impact

Download from
AppendFromXlsx 3.1
or
AppendFromXlsx 3.1 (alternate link)


Related posts
http://praisachion.blogspot.com/2016/06/inspectpptx-10.html
http://praisachion.blogspot.com/2016/06/inspectdocx-10.html

MSOffice -> DBF
http://praisachion.blogspot.com/2018/03/appendfromxlsx-31.html
http://praisachion.blogspot.com/2017/08/importfromxlsx-40.html
http://praisachion.blogspot.com/2017/06/append-from-xlsx-30.html
http://praisachion.blogspot.com/2016/08/importfromxlsx-34.html
http://praisachion.blogspot.com/2016/08/importfromxlsx-33.html
http://praisachion.blogspot.com/2016/06/importfromxlsx-32-appendfromxlsx-21.html
http://praisachion.blogspot.com/2016/06/appendfrompptx-10.html
http://praisachion.blogspot.com/2016/06/appendfromdocx-21.html
http://praisachion.blogspot.com/2016/06/importfromdocx-31.html
http://praisachion.blogspot.com/2016/06/importfrompptx-11.html
http://praisachion.blogspot.com/2016/06/importfromxlsx-31.html
http://praisachion.blogspot.com/2016/06/importfrompptx-10.html
http://praisachion.blogspot.com/2016/06/importfromdocx-30.html
http://praisachion.blogspot.com/2016/05/importfromxlsx-22.html
http://praisachion.blogspot.com/2016/02/import-dbf-from-msoffice-2007-xlsx-docx.html
http://praisachion.blogspot.com/2016/01/importfromdocx-20.html
http://praisachion.blogspot.com/2016/01/appendfromdocx-20.html
http://praisachion.blogspot.com/2016/01/importfromxlsx-13.html
http://praisachion.blogspot.com/2016/01/appendfromxlsx-20.html
http://praisachion.blogspot.com/2015/12/appendfromxlsx-15.html
http://praisachion.blogspot.com/2015/11/importfromxlsx-13.html
http://praisachion.blogspot.com/2015/09/importfromxlsx-12.html
http://praisachion.blogspot.com/2015/09/appendfromxlsx-14.html
http://praisachion.blogspot.com/2015/09/appendfromnxlsx-13.html
http://praisachion.blogspot.com/2015/08/importfromxlsx-11.html
http://praisachion.blogspot.com/2015/07/import-from-xlsx.html
http://praisachion.blogspot.com/2015/07/insert-from-focx.html
http://praisachion.blogspot.com/2015/06/append-from-docx.html

DBF -> MSOffice
Dbf2Xlsx6 4.2 (VFP6) 
http://praisachion.blogspot.com/2017/04/export-dbf-to-excel-2007.html
http://praisachion.blogspot.com/2017/01/export-dbf-to-msexcel-xlsx.html
http://praisachion.blogspot.com/2017/01/export-dbf-to-mspowerpoin-pptx.html
http://praisachion.blogspot.com/2017/01/export-dbf-to-msword-docx.html
http://praisachion.blogspot.com/2016/11/export-to-xlsx.html
http://praisachion.blogspot.com/2016/11/export-to-pptx.html
http://praisachion.blogspot.com/2016/11/export-to-docx.html
http://praisachion.blogspot.com/2016/11/export-from-vfp6-to-msoffice-docx-pptx.html
http://praisachion.blogspot.com/2016/09/copytoxlsx6-10.html
http://praisachion.blogspot.com/2016/01/export-dbf-to-msoffice-2007-xlsx-docx_24.html
http://praisachion.blogspot.com/2016/01/export-dbf-to-msoffice-2007-xlsx-docx.html
http://praisachion.blogspot.com/2016/01/exporttopptx-20.html
http://praisachion.blogspot.com/2016/01/exporttodocx-20.html
http://praisachion.blogspot.com/2016/01/copytopptx-20.html
http://praisachion.blogspot.com/2016/01/exporttoxlsx-20.html
http://praisachion.blogspot.com/2016/01/copytoxlsx-30.html
http://praisachion.blogspot.com/2015/12/exporttoxlsx-19-class.html
http://praisachion.blogspot.com/2015/12/copytoxlsx-210-procedure.html
http://praisachion.blogspot.com/2015/12/exporttoxlsx-18-class.html
http://praisachion.blogspot.com/2015/12/copytoxlsx-29.html
http://praisachion.blogspot.com/2015/02/export-pptx-13.html
http://praisachion.blogspot.com/2015/01/copytodocx-12.html
http://praisachion.blogspot.com/2015/01/exportdocx-1.html

OOffice -> DBF
http://praisachion.blogspot.com/2016/11/import-from-openoffice-libreoffice-for.html
http://praisachion.blogspot.com/2016/09/importfromoowrtext-10.html
http://praisachion.blogspot.com/2016/09/importfromooffice-1o.html
http://praisachion.blogspot.com/2016/08/importfromoocalc.html

DBF -> OOffice
http://praisachion.blogspot.com/2016/09/export-dbf-to-openoffice-libreoffice_52.html
http://praisachion.blogspot.com/2016/09/export-dbf-to-openoffice-libreoffice_16.html
http://praisachion.blogspot.com/2016/09/copy-to-ods-10-openoffice-calc.html
http://praisachion.blogspot.com/2016/09/export-dbf-to-openoffice-libreoffice.html
http://praisachion.blogspot.com/2016/09/copy-to-odt-10.html

 

joi, 4 ianuarie 2018

Changing the hyperlink tooltip

Editboxes can allow following hyperlinks by setting EnableHyperlinks = .T.
In this case, any hyperlink is enhanced (the forecolor is blue and is underlined), and performing a CTRL+click, the default browser is launched.

If the form has Showtips = .T., then the tooltip "CTRL + click to follow the link" is showed each time you point to a hyperlink.

The application object _VFP, has a property named EditorOptions, which allow to switch between CTRL + click and Click to follow hyperlinks (among other things).
EditorOptions is a string, and contains by default "K", meaning CTRL +click for hyperlinks.
If you change "K" into "k", then only a mouse click is needed for the same action (without pressing CTRL).


PUBLIC ofrm
_vfp.EditorOptions = CHRTRAN(_vfp.EditorOptions, "K", "k") && Click instead of CTRL+Click
ofrm = CREATEOBJECT("MyForm")
ofrm.Show()

DEFINE CLASS MyForm as Form
      Showtips = .T.
      ADD OBJECT ed as Editbox WITH Value = "www.foxite.com" + CHR(13) + CHR(13) + "www.google.com",;
             EnableHyperlinks = .T.,;
             width = 300
ENDDEFINE


But the hyperlink tooltip remains unchanged, i.e. shows "CTRL + click to follow the link".

If you want to change this into "Click to follow the link", you have two options.
The easiest way is to disable the hyperlinks tooltip, and to add your own tooltip to editbox.

PUBLIC ofrm
_vfp.EditorOptions = CHRTRAN(_vfp.EditorOptions, "K", "k") && Click instead of CTRL+Click
sys(3008,0) && disable hyperlink tooltips
ofrm = CREATEOBJECT("MyForm")
ofrm.Show()

DEFINE CLASS MyForm as Form
      Showtips = .T.
      ADD OBJECT ed as Editbox WITH Value = "www.foxite.com" + CHR(13) + CHR(13) + "www.google.com",;
             EnableHyperlinks = .T.,;
             width = 300,;
             ToolTipText = "Click to follow link"
ENDDEFINE
 

But pointing hyperlinks, no tooltip is shown.

The second option is to edit (hack) the resource file. The file is stored in HOME(1), and depending on the language, this file is named VFP9ENU.DLL, VFP9KOR.DLL a.s.o

Because all you need is to change a string, you have to locate the position of the string, and to change it into another null-char ended string, with the same length.
Be aware that this is a potential dangerous action.
Make a copy of your DLL, before trying the next one (step one).


1) First made a safety copy of your DLL
2) move it from HOME(1) + VFP9ENU.DLL into a folder with enough rights (d:\teste in the next demo)
3) Run the next prg

ln = FOPEN("d:\teste\VFP9ENU.DLL",12)
?ln
?FSEEK(m.ln,0x5ef8) && 0x5ef8 is the offset of the "CTRL + click to follow link" message
lc = FGETS(m.ln,27) && 27 is the length of the "CTRL + click to follow link" message
lc = "Click to follow link" + REPLICATE(CHR(0),7) && the new message (7 is the number of deleted characters)
?FSEEK(m.ln,0x5ef8)
?FPUTS(m.ln,m.lc,27)
?FCLOSE(m.ln)

 4) copy the modified DLL back to HOME(1)

Similar steps can be made to the runtime DLL, stored in C:\Program Files\Common Files\microsoft shared\VFP and named VFP9RENU.DLL

The prg is a little different, because the string starts from another  byte

ln = FOPEN("d:\teste\VFP9RENU.DLL",12)
?ln
?FSEEK(m.ln,0x5e30) && 0x5e30 is the offset of the "CTRL + click to follow link" message
lc = FGETS(m.ln,27) && 27 is the length of the "CTRL + click to follow link" message
lc = "Click to follow link" + REPLICATE(CHR(0),7) && the new message (7 is the number of deleted characters)
?FSEEK(m.ln,0x5e30)
?FPUTS(m.ln,m.lc,27)
?FCLOSE(m.ln)
RETURN