Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Print photos for passport in Word using QM
#6
Thank you very much, but I was looking for something like this:

Function Photo_passport
Code:
Copy      Help
\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages

str controls = "4 6"
str e4 e6
if(!ShowDialog("Photo_passport" &Photo_passport &controls)) ret

;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 223 135 "Photo_passport"
;1 Button 0x54030001 0x4 120 116 48 14 "OK"
;2 Button 0x54030000 0x4 170 116 48 14 "Cancel"
;3 Button 0x54032000 0x0 22 18 26 14 "File"
;4 Edit 0x54030080 0x200 54 18 138 14 ""
;5 Static 0x54000000 0x0 72 50 40 12 "How many?"
;6 Edit 0x54030080 0x200 112 48 24 14 ""
;END DIALOG
;DIALOG EDITOR: "" 0x2030207 "" "" ""

ret
;messages
sel message
,case WM_INITDIALOG
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case 3
,str- pho
,if(!OpenSaveDialog(0 pho "bmp, jpg, gif[]*.bmp;*.jpg;*.gif[]")) ret
,pho.setwintext(id(4 hDlg))
,case IDOK
,typelib Word {00020905-0000-0000-C000-000000000046} 8.1
,
,int cuantas=val(_s.getwintext(id(6 hDlg)))
,
,run "winword""" "" "" 0x200
,
,Word.Application app._getactive
,Word.Document doc=app.ActiveDocument
,Word.Table table

,app.Selection.InlineShapes.AddPicture(pho)
,doc.InlineShapes.Item(1).LockAspectRatio= -1 ;;msoTrue
,doc.InlineShapes.Item(1).Height=70.84
,doc.InlineShapes.Item(1).Width=50.14
,doc.InlineShapes.Item(1).Select
,app.Selection.Cut
,
,VARIANT worddefault(Word.wdWord9ListBehavior) wordauto(Word.wdAutoFitFixed) wordcell(Word.wdCell)
,doc.Tables.Add(app.Selection.Range 1 8 &worddefault &wordauto)
,app.Selection.Paste
,int i
,rep cuantas-1
,,app.Selection.MoveRight(&wordcell)
,,app.Selection.Paste
,case IDCANCEL
ret 1

sure can be improved ...


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)