1

Konu: Outlook senkronizasyonununda Contacts a resimlerin aktarılması

Herkese selam,
sqlserver2005 deki hasta tablomda hasta resimleri için, "J:\ivf\resimler\13456.jpg" şeklinde resmin yol ve adını tutuyorum.13456 aynı zamanda hasta numarası.
Outlook senkronizasyonunu Contacts a,  hastalar.csv oluşturarak outlookdan import ediyorum.
1. Hasta resimlerini de nasıl aktarabilirim ?
2. outlook import işemini fox içinden yapabilirmiyim ?
Teşekkürler
Mesut Çelikkol

2

Re: Outlook senkronizasyonununda Contacts a resimlerin aktarılması

Senin için bir örnek yazdım. Çok iyi bir kod olmadı ama sana yardımcı olur

Visual Fox Pro
1

2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
Public oForm

oForm = Createobject("frmOutlookOrnek")
oForm.Show()
 
DEFINE CLASS frmoutlookornek AS form
 
 
    Height = 265
    Width = 386
    DoCreate = .T.
    AutoCenter = .T.
    Caption = "Outlook Örnek"
    *-- XML Metadata for customizable properties
    _memberdata = [<VFPData><memberdata name="isclassregistered" type="method" display="IsClassRegistered"/><memberdata name="aklasorler" type="property" display="aKlasorler"/><memberdata name="nklasor" type="property" display="nKlasor"/><memberdata name="ocontac" type="property" display="oContac"/><memberdata name="onamespace" type="property" display="oNameSpace"/><memberdata name="ooutlook" type="property" display="oOutlook"/><memberdata name="klasoryaz" type="method" display="KlasorYaz"/><memberdata name="klasorbul" type="method" display="KlasorBul"/><memberdata name="al" type="method" display="Al"/><memberdata name="tabloolustur" type="method" display="TabloOlustur"/><memberdata name="ocontanc" type="property" display="oContanc"/></VFPData>]
    nklasor = 0
    ocontanc = .NULL.
    onamespace = .NULL.
    ooutlook = .NULL.
    Name = "frmOutlookOrnek"
    DIMENSION aklasorler[1]
 
 
    ADD OBJECT opgklasor AS optiongroup WITH ;
        ButtonCount = 2, ;
        Value = 1, ;
        Height = 30, ;
        Left = 6, ;
        Top = 12, ;
        Width = 202, ;
        Name = "opgKlasor", ;
        Option1.Caption = "Ortak Klasör", ;
        Option1.Value = 1, ;
        Option1.Height = 17, ;
        Option1.Left = 5, ;
        Option1.Top = 5, ;
        Option1.Width = 91, ;
        Option1.Name = "optOrtakKlasor", ;
        Option2.Caption = "Kişisel Klasör", ;
        Option2.Height = 17, ;
        Option2.Left = 102, ;
        Option2.Top = 6, ;
        Option2.Width = 97, ;
        Option2.Name = "optKisiselKlasor"
 
 
    ADD OBJECT label1 AS label WITH ;
        Caption = "Oultlook Klasörü", ;
        Height = 17, ;
        Left = 6, ;
        Top = 48, ;
        Width = 96, ;
        Name = "Label1"
 
 
    ADD OBJECT cboklasor AS combobox WITH ;
        ColumnCount = (ALEN(ThisForm.aKlasorler,2)), ;
        RowSourceType = 5, ;
        RowSource = "ThisForm.aKlasorler", ;
        Value = 1, ;
        Height = 24, ;
        Left = 6, ;
        NumberOfElements = (ALEN(ThisForm.aKlasorler)), ;
        Style = 2, ;
        Top = 66, ;
        Width = 282, ;
        Name = "cboKlasor"
 
 
    ADD OBJECT cmdal AS commandbutton WITH ;
        Top = 65, ;
        Left = 295, ;
        Height = 27, ;
        Width = 84, ;
        Caption = "\<Al", ;
        Name = "cmdAl"
 
 
    ADD OBJECT grdkisiler AS grid WITH ;
        ColumnCount = 2, ;
        Anchor = 15, ;
        DeleteMark = .F., ;
        Height = 162, ;
        Left = 6, ;
        ReadOnly = .T., ;
        RecordSource = "Kisiler", ;
        Top = 96, ;
        Width = 372, ;
        HighlightStyle = 1, ;
        Name = "grdKisiler", ;
        Column1.ControlSource = "Kisiler.cAd", ;
        Column1.ReadOnly = .T., ;
        Column1.Name = "Column1", ;
        Column2.ControlSource = "Kisiler.cSoyad", ;
        Column2.ReadOnly = .T., ;
        Column2.Name = "Column2"
 
 
    ADD OBJECT frmoutlookornek.grdkisiler.column1.header1 AS header WITH ;
        Caption = "Ad", ;
        Name = "Header1"
 
 
    ADD OBJECT frmoutlookornek.grdkisiler.column1.text1 AS textbox WITH ;
        BorderStyle = 0, ;
        Margin = 0, ;
        ReadOnly = .T., ;
        ForeColor = RGB(0,0,0), ;
        BackColor = RGB(255,255,255), ;
        Name = "Text1"
 
 
    ADD OBJECT frmoutlookornek.grdkisiler.column2.header1 AS header WITH ;
        Caption = "Soyad", ;
        Name = "Header1"
 
 
    ADD OBJECT frmoutlookornek.grdkisiler.column2.text1 AS textbox WITH ;
        BorderStyle = 0, ;
        Margin = 0, ;
        ReadOnly = .T., ;
        ForeColor = RGB(0,0,0), ;
        BackColor = RGB(255,255,255), ;
        Name = "Text1"
 
 
    PROCEDURE isclassregistered
        LParameters tcClass
        #Define HKEY_CLASSES_ROOT   -2147483648
        #Define ERROR_SUCCESS       0
 
        Declare Integer RegOpenKey In Win32API ;
            Integer nHKey, String @cSubKey, Integer @nResult
 
        Declare Integer RegCloseKey In Win32API ;
            Integer nHKey
 
        Local lnKey
        lnKey = 0
        llRetVal = (RegOpenKey(HKEY_CLASSES_ROOT, tcClass, @lnKey) = ERROR_SUCCESS)
        If llRetVal
          RegCloseKey(lnKey)
        EndIf
 
        Return llRetVal
    ENDPROC
 
 
    PROCEDURE klasoryaz
        LParameters toHedefKlasor As Object, tcKlasorYolu As String
 
        Local loKlasorler As Object, loKlasor As Object
        m.loKlasorler = m.toHedefKlasor.Folders
 
        m.tcKlasorYolu = IIf(Empty(m.tcKlasorYolu), "", m.tcKlasorYolu + "\") + m.toHedefKlasor.Name
 
        ThisForm.aKlasorler[ALen(ThisForm.aKlasorler)] = m.tcKlasorYolu
        For Each m.loKlasor In m.loKlasorler
            Dimension ThisForm.aKlasorler[ALen(ThisForm.aKlasorler) + 1]
            ThisForm.KlasorYaz(m.toHedefKlasor.Folders(m.loKlasor.Name), m.tcKlasorYolu)
        EndFor
    ENDPROC
 
 
    PROCEDURE klasorbul
        LParameters toHedefKlasor As Object, tcKlasorYolu As String
 
        m.tcKlasorYolu = IIf(Empty(m.tcKlasorYolu), '', m.tcKlasorYolu + '\') + m.toHedefKlasor.Name
 
        If m.tcKlasorYolu = ThisForm.aKlasorler(ThisForm.cboKlasor.Value)
            Return m.toHedefKlasor
        Else
            Local loKlasorler As Object, loKlasor As Object, lvSonuc As Variant
            m.loKlasorler = m.toHedefKlasor.Folders
 
            For Each m.loKlasor In m.loKlasorler
                m.lvSonuc = ThisForm.KlasorBul(m.toHedefKlasor.Folders(m.loKlasor.Name), m.tcKlasorYolu)
                If VarType(m.lvSonuc) = "O"
                    Return m.lvSonuc
                EndIf
            EndFor
        EndIf
    ENDPROC
 
 
    PROCEDURE al
        Local loContancs As Object, loContanc As Object
        With ThisForm
            .oContanc = .KlasorBul(.oNameSpace.GetDefaultFolder(.nKlasor), '')
            m.loContanc = .oContanc.Items.Restrict("[MessageClass] >= 'IPM.Contact' AND [MessageClass] <= 'IPM.Contact'")
 
            .grdKisiler.RecordSource = ""
            .TabloOlustur
            For Each m.loContanc IN m.loContanc
                Insert Into Kisiler Values(m.loContanc.FirstName, m.loContanc.LastName)
            EndFor
            Go Top In Kisiler
            With .grdKisiler
                .RecordSource = "Kisiler"
                .Column1.ControlSource = "Kisiler.cAd"
                .Column1.ControlSource = "Kisiler.cSoyad"
            EndWith
        EndWith
    ENDPROC
 
 
    PROCEDURE tabloolustur
        Create Cursor Kisiler (cAd C(50), cSoyad C(50))
    ENDPROC
 
 
    PROCEDURE Load
        With ThisForm
            If !.IsClassRegistered("Outlook.Application")
                MessageBox( "Sisteminizde Outlook yüklü değildir.", 16, "Hata")
                Return .F.
            EndIf
            .TabloOlustur
            DoDefault()
        EndWith
    ENDPROC
 
 
    PROCEDURE Destroy
        With ThisForm
            .oContanc   = .Null.
            .oNameSpace = .Null.
            .oOutlook   = .Null.
            DoDefault()
        EndWith
    ENDPROC
 
 
    PROCEDURE Init
        With ThisForm
 
            .oOutlook   = CreateObject("Outlook.Application")
            .oNameSpace = .oOutlook.GetNameSpace("MAPI")
            Try
                .KlasorYaz(.oNameSpace.GetDefaultFolder(18), "")
                .nKlasor = 18
            Catch
                Try
                    .KlasorYaz(.oNameSpace.GetDefaultFolder(10), "")
                    .nKlasor = 10
                    .opgKlasor.Value = 2
                    .opgKlasor.optOrtakKlasor.Enabled = .F.
                Catch
                    MessageBox("Outlook ayarlarınız tam değil!", 48, "Uyarı")
                    Return .F.
                EndTry
            EndTry
            .cboKlasor.NumberOfelements = ALen(.aKlasorler)
        EndWith
    ENDPROC
 
 
    PROCEDURE cmdal.Click
        ThisForm.Al
    ENDPROC
 
 
ENDDEFINE
*
*-- EndDefine: frmoutlookornek
**************************************************

Son düzenleyen, taRKan (23.07.2008 13:52:52)

/o---------------------o\
     www.haser.com
\o---------------------o/

3

Re: Outlook senkronizasyonununda Contacts a resimlerin aktarılması

tarkan bey bu gönderdiğiniz bilgiyi scx e nasıl çevirirebilirim.

Bilmediğin Neyse Yanıldığındır.

4

Re: Outlook senkronizasyonununda Contacts a resimlerin aktarılması

http://www.haser.com/Downloads/VFP/OutlookOrnek.rar

/o---------------------o\
     www.haser.com
\o---------------------o/

5

Re: Outlook senkronizasyonununda Contacts a resimlerin aktarılması

Tarkan bey, bu kodlar outlookda var olan kayıtların fox a aktarımını gerçekleştiriyor. teşekkürler.
Ancak benim takıldığım. sql deki verilerimi her seferinde tekrar güncelliyerek (tlf, adres vs), önce csv formatında bir dosyaya atıp, bu dosyayı Outlook dan contacts a import ediyorum.  fakat kayıtların resimlerini aktaramıyorum. Tüm Arkadaşlardan Resimleri aktarma konusunda yardım istiyorum.
Mesut Çelikkol

6

Re: Outlook senkronizasyonununda Contacts a resimlerin aktarılması

http://www.haser.com/Downloads/VFP/OutlookOrnek.rar

Adresine Outlooktan bilgi alan ve veren program örneğini gönderdim. Bu örnek içinde resim eklemede var.

Not: SQL'den bilgi eklemeyi sen yaparsın diye düşünüyorum.

/o---------------------o\
     www.haser.com
\o---------------------o/

7

Re: Outlook senkronizasyonununda Contacts a resimlerin aktarılması

Visual Fox Pro
1

2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
**************************************************

*-- Form:         frmoutlookornek (c:\projeler\outlookornek.scx)
*-- ParentClass:  form
*-- BaseClass:    form
*-- Time Stamp:   07/31/08 06:25:04 PM
*
*
DEFINE CLASS frmoutlookornek AS form
 
 
    Height = 473
    Width = 521
    DoCreate = .T.
    ShowTips = .T.
    AutoCenter = .T.
    Caption = "Outlook Örnek"
    *-- XML Metadata for customizable properties
    _memberdata = [<VFPData><memberdata name="isclassregistered" type="method" display="IsClassRegistered"/><memberdata name="aklasorler" type="property" display="aKlasorler"/><memberdata name="nklasor" type="property" display="nKlasor"/><memberdata name="ocontac" type="property" display="oContac"/><memberdata name="onamespace" type="property" display="oNameSpace"/><memberdata name="ooutlook" type="property" display="oOutlook"/><memberdata name="klasoryaz" type="method" display="KlasorYaz"/><memberdata name="klasorbul" type="method" display="KlasorBul"/><memberdata name="al" type="method" display="Al"/><memberdata name="tabloolustur" type="method" display="TabloOlustur"/><memberdata name="ocontanc" type="property" display="oContanc"/><memberdata name="ver" type="method" display="Ver"/></VFPData>]
    nklasor = 0
    ocontanc = .NULL.
    onamespace = .NULL.
    ooutlook = .NULL.
    Name = "frmOutlookOrnek"
    DIMENSION aklasorler[1]
 
 
    ADD OBJECT shape1 AS shape WITH ;
        Top = 381, ;
        Left = 6, ;
        Height = 57, ;
        Width = 507, ;
        Anchor = 10, ;
        Name = "Shape1"
 
 
    ADD OBJECT opgklasor AS optiongroup WITH ;
        ButtonCount = 2, ;
        Value = 1, ;
        Height = 30, ;
        Left = 6, ;
        Top = 132, ;
        Width = 202, ;
        Name = "opgKlasor", ;
        Option1.Caption = "Ortak Klasör", ;
        Option1.Value = 1, ;
        Option1.Height = 17, ;
        Option1.Left = 5, ;
        Option1.Top = 5, ;
        Option1.Width = 91, ;
        Option1.Name = "optOrtakKlasor", ;
        Option2.Caption = "Kişisel Klasör", ;
        Option2.Height = 17, ;
        Option2.Left = 102, ;
        Option2.Top = 6, ;
        Option2.Width = 97, ;
        Option2.Name = "optKisiselKlasor"
 
 
    ADD OBJECT label1 AS label WITH ;
        Caption = "Outook Klasörü", ;
        Height = 17, ;
        Left = 6, ;
        Top = 168, ;
        Width = 96, ;
        Name = "Label1"
 
 
    ADD OBJECT cboklasor AS combobox WITH ;
        Anchor = 10, ;
        ColumnCount = (ALEN(ThisForm.aKlasorler,2)), ;
        RowSourceType = 5, ;
        RowSource = "ThisForm.aKlasorler", ;
        Value = 1, ;
        Height = 24, ;
        Left = 6, ;
        NumberOfElements = (ALEN(ThisForm.aKlasorler)), ;
        Style = 2, ;
        Top = 186, ;
        Width = 414, ;
        Name = "cboKlasor"
 
 
    ADD OBJECT cmdal AS commandbutton WITH ;
        Top = 186, ;
        Left = 429, ;
        Height = 27, ;
        Width = 84, ;
        Anchor = 8, ;
        Caption = "\<Al", ;
        Name = "cmdAl"
 
 
    ADD OBJECT grdkisiler AS grid WITH ;
        ColumnCount = 4, ;
        Anchor = 15, ;
        DeleteMark = .F., ;
        Height = 162, ;
        Left = 6, ;
        Panel = 1, ;
        RecordSource = "Kisiler", ;
        Top = 216, ;
        Width = 510, ;
        HighlightStyle = 1, ;
        Name = "grdKisiler", ;
        Column1.ControlSource = "Kisiler.cAd", ;
        Column1.ReadOnly = .T., ;
        Column1.Name = "Column1", ;
        Column2.ControlSource = "Kisiler.cSoyad", ;
        Column2.ReadOnly = .T., ;
        Column2.Name = "Column2", ;
        Column3.ControlSource = "Kisiler.cIsTelefonu", ;
        Column3.Width = 121, ;
        Column3.Name = "Column3", ;
        Column4.ControlSource = "Kisiler.cResim", ;
        Column4.Width = 202, ;
        Column4.ToolTipText = "Çift tıklayarak resim seçebilirsiniz.", ;
        Column4.Name = "Column4"
 
 
    ADD OBJECT frmoutlookornek.grdkisiler.column1.header1 AS header WITH ;
        Caption = "Ad", ;
        Name = "Header1"
 
 
    ADD OBJECT frmoutlookornek.grdkisiler.column1.text1 AS textbox WITH ;
        BorderStyle = 0, ;
        Margin = 0, ;
        ReadOnly = .T., ;
        ForeColor = RGB(0,0,0), ;
        BackColor = RGB(255,255,255), ;
        Name = "Text1"
 
 
    ADD OBJECT frmoutlookornek.grdkisiler.column2.header1 AS header WITH ;
        Caption = "Soyad", ;
        Name = "Header1"
 
 
    ADD OBJECT frmoutlookornek.grdkisiler.column2.text1 AS textbox WITH ;
        BorderStyle = 0, ;
        Margin = 0, ;
        ReadOnly = .T., ;
        ForeColor = RGB(0,0,0), ;
        BackColor = RGB(255,255,255), ;
        Name = "Text1"
 
 
    ADD OBJECT frmoutlookornek.grdkisiler.column3.header1 AS header WITH ;
        Caption = "İş Telefonu", ;
        Name = "Header1"
 
 
    ADD OBJECT frmoutlookornek.grdkisiler.column3.text1 AS textbox WITH ;
        BorderStyle = 0, ;
        Margin = 0, ;
        ReadOnly = .F., ;
        ForeColor = RGB(0,0,0), ;
        BackColor = RGB(255,255,255), ;
        Name = "Text1"
 
 
    ADD OBJECT frmoutlookornek.grdkisiler.column4.header1 AS header WITH ;
        Caption = "Resim", ;
        Name = "Header1"
 
 
    ADD OBJECT frmoutlookornek.grdkisiler.column4.text1 AS textbox WITH ;
        BorderStyle = 0, ;
        Margin = 0, ;
        ForeColor = RGB(0,0,0), ;
        BackColor = RGB(255,255,255), ;
        Name = "Text1"
 
 
    ADD OBJECT cmdver AS commandbutton WITH ;
        Top = 439, ;
        Left = 426, ;
        Height = 27, ;
        Width = 84, ;
        Anchor = 12, ;
        Caption = "\<Ver", ;
        Name = "cmdVer"
 
 
    ADD OBJECT oleprogreebar AS olecontrol WITH ;
        Top = 386, ;
        Left = 10, ;
        Height = 20, ;
        Width = 494, ;
        TabIndex = 13, ;
        ZOrderSet = 10, ;
        Anchor = 10, ;
        Name = "oleProgreeBar"
 
 
    ADD OBJECT lblkayit AS label WITH ;
        AutoSize = .T., ;
        Caption = "Kayıt :", ;
        Height = 17, ;
        Left = 13, ;
        Top = 414, ;
        Width = 34, ;
        Name = "lblKayit"
 
 
    ADD OBJECT edtbilgi AS editbox WITH ;
        Anchor = 10, ;
        Enabled = .F., ;
        Height = 120, ;
        Left = 6, ;
        ScrollBars = 0, ;
        Top = 6, ;
        Width = 505, ;
        DisabledForeColor = RGB(0,0,0), ;
        Name = "edtBilgi"
 
 
    PROCEDURE isclassregistered
        LParameters tcClass
        #Define HKEY_CLASSES_ROOT   -2147483648
        #Define ERROR_SUCCESS       0
 
        Declare Integer RegOpenKey In Win32API ;
            Integer nHKey, String @cSubKey, Integer @nResult
 
        Declare Integer RegCloseKey In Win32API ;
            Integer nHKey
 
        Local lnKey
        lnKey = 0
        llRetVal = (RegOpenKey(HKEY_CLASSES_ROOT, tcClass, @lnKey) = ERROR_SUCCESS)
        If llRetVal
          RegCloseKey(lnKey)
        EndIf
 
        Return llRetVal
    ENDPROC
 
 
    PROCEDURE klasoryaz
        LParameters toHedefKlasor As Object, tcKlasorYolu As String
 
        Local loKlasorler As Object, loKlasor As Object
        m.loKlasorler = m.toHedefKlasor.Folders
 
        m.tcKlasorYolu = IIf(Empty(m.tcKlasorYolu), "", m.tcKlasorYolu + "\") + m.toHedefKlasor.Name
 
        ThisForm.aKlasorler[ALen(ThisForm.aKlasorler)] = m.tcKlasorYolu
        For Each m.loKlasor In m.loKlasorler
            Dimension ThisForm.aKlasorler[ALen(ThisForm.aKlasorler) + 1]
            ThisForm.KlasorYaz(m.toHedefKlasor.Folders(m.loKlasor.Name), m.tcKlasorYolu)
        EndFor
    ENDPROC
 
 
    PROCEDURE klasorbul
        LParameters toHedefKlasor As Object, tcKlasorYolu As String
 
        m.tcKlasorYolu = IIf(Empty(m.tcKlasorYolu), '', m.tcKlasorYolu + '\') + m.toHedefKlasor.Name
 
        If m.tcKlasorYolu = ThisForm.aKlasorler(ThisForm.cboKlasor.Value)
            Return m.toHedefKlasor
        Else
            Local loKlasorler As Object, loKlasor As Object, lvSonuc As Variant
            m.loKlasorler = m.toHedefKlasor.Folders
 
            For Each m.loKlasor In m.loKlasorler
                m.lvSonuc = ThisForm.KlasorBul(m.toHedefKlasor.Folders(m.loKlasor.Name), m.tcKlasorYolu)
                If VarType(m.lvSonuc) = "O"
                    Return m.lvSonuc
                EndIf
            EndFor
        EndIf
    ENDPROC
 
 
    PROCEDURE al
        Local loContancs As Object, loContanc As Object
        With ThisForm
            .oContanc = .KlasorBul(.oNameSpace.GetDefaultFolder(.nKlasor), '')
            m.loContanc = .oContanc.Items.Restrict("[MessageClass] >= 'IPM.Contact' AND [MessageClass] <= 'IPM.Contact'")
 
            .grdKisiler.RecordSource = ""
            .TabloOlustur
            For Each m.loContanc IN m.loContanc
                Insert Into Kisiler Values(m.loContanc.FirstName, m.loContanc.LastName, ;
                                            m.loContanc.BusinessTelephoneNumber, IIf(m.loContanc.HasPicture, "Daha önce tanımlanmış resmi var!", ""))
            EndFor
            Go Top In Kisiler
            With .grdKisiler
                .RecordSource = "Kisiler"
                .Column1.ControlSource = "Kisiler.cAd"
                .Column2.ControlSource = "Kisiler.cSoyad"
                .Column3.ControlSource = "Kisiler.cIsTelefonu"
                .Column4.ControlSource = "Kisiler.cResim"
            EndWith
        EndWith
    ENDPROC
 
 
    PROCEDURE tabloolustur
        Create Cursor Kisiler (cAd C(50), cSoyad C(50), cIsTelefonu C(20), cResim C(254))
    ENDPROC
 
 
    PROCEDURE ver
        With ThisForm
            .oContanc = .KlasorBul(.oNameSpace.GetDefaultFolder(.nKlasor), '')
 
            If RecCount("Kisiler") > 0
                .oleProgreeBar.Max = RecCount("Kisiler")
            EndIf
 
            Go Top In Kisiler
            Do While !EOF("Kisiler")
                .oleProgreeBar.Value = Int(.oleProgreeBar.Value) + 1
                .lblKayit.Caption = "Kayıt : " + AllTrim(Transform(.oleProgreeBar.Value, "99,999")) + " / " + ;
                            AllTrim(Transform(.oleProgreeBar.Max, "99,999")) + " " + AllTrim(Kisiler.cAd) + " " + AllTrim(Kisiler.cSoyad)
                m.lcKosul = "[FirstName] = '" + AllTrim(Kisiler.cAd) + "' And [LastName] = '" + AllTrim(Kisiler.cSoyad) + "'"
                m.loItem = .oContanc.Items.Find(m.lcKosul)
                If IsNull(m.loItem)
                    m.loItem = .oContanc.Items.Add
                EndIf
                With m.loItem
                    .FirstName                  = AllTrim(Kisiler.cAd)
                    .LastName                   = AllTrim(Kisiler.cSoyad)
                    .BusinessTelephoneNumber    = AllTrim(Kisiler.cIsTelefonu)
                    If File(Kisiler.cResim)
                        Try
                            .AddPicture(AllTrim(Kisiler.cResim))
                        Catch
                        EndTry
                    EndIf
                    .Save
                EndWith
                Skip In Kisiler
            EndDo
 
            MessageBox("İşlem tamamlandı!", 64, "BİLGİ")
        EndWith
    ENDPROC
 
 
    PROCEDURE Load
        With ThisForm
            If !.IsClassRegistered("Outlook.Application")
                MessageBox( "Sisteminizde Outlook yüklü değildir.", 16, "Hata")
                Return .F.
            EndIf
            .TabloOlustur
            DoDefault()
        EndWith
    ENDPROC
 
 
    PROCEDURE Destroy
        With ThisForm
            .oContanc   = .Null.
            .oNameSpace = .Null.
            .oOutlook   = .Null.
            DoDefault()
        EndWith
    ENDPROC
 
 
    PROCEDURE Init
        With ThisForm
            .edtBilgi.Value = ;
                "Outlook Klasörünü seçip 'Al' düğmesine basarak kişi bigilerini alın." + Chr(13) + ;
                Chr(13) + ;
                "'İş Telefonu' ve 'Resim' bilgilerini değiştirerek 'Ver' düğmesine basarak bilgileri güncelleyin." + Chr(13) + ;
                Chr(13) + ;
                "Resim seçmek için resim hücresine çift tıklayabilirsiniz." + Chr(13) + ;
                Chr(13) + ;
                "Haser Yazılım Temmuz 2008"
 
            .oOutlook   = CreateObject("Outlook.Application")
            .oNameSpace = .oOutlook.GetNameSpace("MAPI")
            Try
                .KlasorYaz(.oNameSpace.GetDefaultFolder(18), "")
                .nKlasor = 18
            Catch
                Try
                    .KlasorYaz(.oNameSpace.GetDefaultFolder(10), "")
                    .nKlasor = 10
                    .opgKlasor.Value = 2
                    .opgKlasor.optOrtakKlasor.Enabled = .F.
                Catch
                    MessageBox("Outlook ayarlarınız tam değil!", 48, "Uyarı")
                    Return .F.
                EndTry
            EndTry
            .cboKlasor.NumberOfelements = ALen(.aKlasorler)
        EndWith
    ENDPROC
 
 
    PROCEDURE cmdal.Click
        ThisForm.Al
    ENDPROC
 
 
    PROCEDURE text1.DblClick
        Local lcResim As String
        m.lcResim = GetPict()
        If !Empty(m.lcResim)
            Replace cResim With m.lcResim In Kisiler
            This.Refresh
        EndIf
    ENDPROC
 
 
    PROCEDURE cmdver.Click
        ThisForm.Ver
    ENDPROC
 
 
ENDDEFINE
*
*-- EndDefine: frmoutlookornek
**************************************************

Son düzenleyen, taRKan (02.08.2008 13:24:16)

/o---------------------o\
     www.haser.com
\o---------------------o/