powered by simpleCommunicator - 2.0.51     © 2025 Programmizd 02
Форумы / PowerBuilder [игнор отключен] [закрыт для гостей] / Outlook: Insert row
4 сообщений из 4, страница 1 из 1
Outlook: Insert row
    #34139039
Фотография Riska
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Мне нужно перетащить данные из базы данных в Outlook. Кто-нибудь делал такое?
Все, что нашел на форумах - отправка мэилов и получение данных. А вот как внести - нет.
...
Рейтинг: 0 / 0
Outlook: Insert row
    #34148959
Фотография Riska
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Код: plaintext
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.
OLEObject 	ole_outlook, namespace, folder, ole_contact  
Integer 		li_retval 
Boolean 		WasOpen 
long 			ll_row_count, ll_mis_maasik
String 		ls_response
String 		ls_data 

ole_outlook = CREATE OLEObject 

SetPointer(HourGlass!) 

// ~~~~~~~~~~~~~~~~~~~ START ~~~   C O N N E C T   T O   O U T L O O K ~~~~~~~~~~~~~~~~~~~~~~~~~~~

//First try connect to open outlook 
li_retval = ole_outlook.ConnectToObject("", "outlook.application") 
IF li_retval =  0  THEN 
	WasOpen = TRUE 
ELSE 
	// Didnét work lets try open word and connect to it 
	WasOpen = FALSE 
	li_retval = ole_outlook.ConnectToNewObject("outlook.application") 
END IF 

IF li_retval <>  0   THEN 
	// Problems with the connection 
	CHOOSE CASE li_retval 
		CASE  5 
		 // Fill inn the right ones here 
		 ls_response = '...'
		CASE ELSE 
		 ls_response = "Some Outlook error" 
	END CHOOSE 
	MessageBox("OLE Error - (" + String(li_retval) + ")", ls_response, StopSign!, OK!) 
	
	// It failed lets clean up after us and quit 
	ole_outlook.DisconnectObject() 
	DESTROY ole_outlook 
ELSE 
	// Lets hide word untill we are done with the automation. 
END IF 
SetPointer(Arrow!) 

// ~~~~~~~~~~~~~~~~~~~ END ~~~      C O N N E C T   T O   O U T L O O K ~~~~~~~~~~~~~~~~~~~~~~~~~~~

/* 19/11/2006 Michael - ***************************************
// START *********** Insert data into the Outlook *************
***************************************************************/


// Find the right place to insert an item 
namespace = ole_outlook.GetNameSpace("MAPI") 
folder = namespace.Folders( 1 ).Folders("Contacts") // This thing is case sensitive  Inbox
SetPointer(HourGlass!) 

// Create one outlook item 
	ole_contact = folder.Items.Add
//++++++++++++++++++++++++++++++++++++++++   Set data   +++++++++++++++++++++++++++++++++
	ls_data = 'e_mail@mmm.com'
	IF IsNull(ls_data) THEN 
	 ls_data = "" 
	END IF 
	ole_contact.Email1Address = ls_data 

	ls_data = 'mmm'
	IF IsNull(ls_data) THEN 
	 ls_data = "" 
	END IF 
	ole_contact.Email1DisplayName = ls_data

/*
Account Property 
Actions Property
Anniversary Property 
Application Property 
AssistantName Property 
AssistantTelephoneNumber Property 
Attachments Property 
AutoResolvedWinner Property 
BillingInformation Property 
Birthday Property 
Body Property 
Business2TelephoneNumber Property 
BusinessAddress Property 
BusinessAddressCity Property 
BusinessAddressCountry Property 
BusinessAddressPostalCode Property 
BusinessAddressPostOfficeBox Property 
BusinessAddressState Property 
BusinessAddressStreet Property 
BusinessFaxNumber Property 
BusinessHomePage Property 
BusinessTelephoneNumber Property 
CallbackTelephoneNumber Property 
CarTelephoneNumber Property 
Categories Property 
Children Property 
Class Property 
Companies Property 
CompanyAndFullName Property 
CompanyLastFirstNoSpace Property 
CompanyLastFirstSpaceOnly Property 
CompanyMainTelephoneNumber Property 
CompanyName Property 
ComputerNetworkName Property 
Conflicts Property 
ConversationIndex Property 
ConversationTopic Property 
CreationTime Property 
CustomerID Property 
Department Property 
DownloadState Property 
Email1Address Property 
Email1AddressType Property 
Email1DisplayName Property 
Email1EntryID Property 
Email2Address Property 
Email2AddressType Property 
Email2DisplayName Property 
Email2EntryID Property 
Email3Address Property 
Email3AddressType Property 
Email3DisplayName Property 
Email3EntryID Property 
EntryID Property 
FileAs Property 
FirstName Property 
FormDescription Property 
FTPSite Property 
FullName Property 
FullNameAndCompany Property 
Gender Property 
GetInspector Property 
GovernmentIDNumber Property 
HasPicture Property 
Hobby Property 
Home2TelephoneNumber Property 
HomeAddress Property 
HomeAddressCity Property 
HomeAddressCountry Property 
HomeAddressPostalCode Property 
HomeAddressPostOfficeBox Property 
HomeAddressState Property 
HomeAddressStreet Property 
HomeFaxNumber Property 
HomeTelephoneNumber Property 
IMAddress Property 
Importance Property 
Initials Property 
InternetFreeBusyAddress Property 
IsConflict Property 
ISDNNumber Property 
ItemProperties Property 
JobTitle Property 
Journal Property 
Language Property 
LastFirstAndSuffix Property 
LastFirstNoSpace Property 
LastFirstNoSpaceAndSuffix Property 
LastFirstNoSpaceCompany Property 
LastFirstSpaceOnly Property 
LastFirstSpaceOnlyCompany Property 
LastModificationTime Property 
LastName Property 
LastNameAndFirstName Property 
Links Property 
MailingAddress Property 
MailingAddressCity Property 
MailingAddressCountry Property 
MailingAddressPostalCode Property 
MailingAddressPostOfficeBox Property 
MailingAddressState Property 
MailingAddressStreet Property 
ManagerName Property 
MarkForDownload Property 
MessageClass Property 
MiddleName Property 
Mileage Property 
MobileTelephoneNumber Property 
NetMeetingAlias Property 
NetMeetingServer Property 
NickName Property 
NoAging Property 
OfficeLocation Property 
OrganizationalIDNumber Property 
OtherAddress Property 
OtherAddressCity Property 
OtherAddressCountry Property 
OtherAddressPostalCode Property 
OtherAddressPostOfficeBox Property 
OtherAddressState Property 
OtherAddressStreet Property 
OtherFaxNumber Property 
OtherTelephoneNumber Property 
OutlookInternalVersion Property 
OutlookVersion Property 
PagerNumber Property 
Parent Property 
PersonalHomePage Property 
PrimaryTelephoneNumber Property 
Profession Property 
RadioTelephoneNumber Property 
ReferredBy Property 
Saved Property 
SelectedMailingAddress Property 
Sensitivity Property 
Session Property 
Size Property 
Spouse Property 
Subject Property 
Suffix Property 
TelexNumber Property 
Title Property 
TTYTDDTelephoneNumber Property 
UnRead Property 
User1 Property 
User2 Property 
User3 Property 
User4 Property 
UserCertificate Property 
UserProperties Property 
WebPage Property 
YomiCompanyName Property 
YomiFirstName Property 
YomiLastName Property 
AddPicture Method 
Close Method 
Copy Method 
Delete Method 
Display Method 
ForwardAsVcard Method
Move Method 
PrintOut Method 
RemovePicture Method 
Save Method 
SaveAs Method 
ShowCategoriesDialog Method 
AttachmentAdd Event 
AttachmentRead Event 
BeforeAttachmentSave Event 
BeforeCheckNames Event 
BeforeDelete Event 
Close Event 
CustomAction Event 
CustomPropertyChange Event 
Forward Event 
Open Event 
PropertyChange Event 
Read Event 
Reply Event 
ReplyAll Event 
Send Event 
Write Event 
Actions Object 
Attachments Object 
Conflicts Object 
FormDescription Object 
ItemProperties Object 
Links Object 
UserProperties Object 
*/
//++++++++++++++++++++++++++++++++++++++++   Set data   +++++++++++++++++++++++++++++++++
	// Save out ole_contact 
	ole_contact.Save 

/* 19/11/2006 Michael - ***************************************
// END     *********    Insert data into the Outlook **********
***************************************************************/

SetPointer(Arrow!) 
MessageBox("Information", "Done Transfering contacts to outlook") 

IF NOT WasOpen THEN 
	ole_outlook.Application.Quit() 
END IF 

ole_outlook.DisconnectObject() 
DESTROY ole_outlook
...
Рейтинг: 0 / 0
Outlook: Insert row
    #34623693
Фотография Riska
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Нужно все это засунуть не в свой Outlook, а чужой. Т.е. есть у нас связь с другим компом (с другим Outlook). Все, что нужно сделать, - это подсоединиться из нашего Outlook к "Klient1", а не к "Contacts".
...
Рейтинг: 0 / 0
Период между сообщениями больше года.
Outlook: Insert row
    #36040796
oldzas
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
вот это надо поменять

folder = namespace.Folders(1).Folders("Contacts")

вот на это, надо просто прописать полностью

folder = namespace.Folders(1).Folders("Contacts").Folders("Klient1")
...
Рейтинг: 0 / 0
4 сообщений из 4, страница 1 из 1
Форумы / PowerBuilder [игнор отключен] [закрыт для гостей] / Outlook: Insert row
Целевая тема:
Создать новую тему:
Автор:
Закрыть
Цитировать
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]