PDA

View Full Version : استفاده از امکانات office در دلفی



najafi_1
سه شنبه 22 اردیبهشت 1383, 09:56 صبح
با سلام به تمام اساتید محترم
همانطور که میدانید و در تصویر پیوست هم مشاهده میکیند در میان پالتها و کامپوننت ها در دلفی پالتی به نام servers داریم که امکان استفاده از برخی برنامه های آفیس را میدهد.
در این خصوص مثلا نحوه دسترسی به یک فایل ورد یا اکسل از این طریق را نیاز دارم.
نحوه معرفی-برقرار ارتباط - تعیین نام فایل- محل باز کردن و . . .
قبلا ممنون هستم.

omidsm
سه شنبه 22 اردیبهشت 1383, 10:31 صبح
بهتره از office partner استفاده کنی 8)

najafi_1
سه شنبه 22 اردیبهشت 1383, 11:05 صبح
امید خان با سلام
من اصلا با این قسمت آسنا نیستم
اگه ممکنه در مورد office partner توضیح بده ممنون :flower:

omidsm
سه شنبه 22 اردیبهشت 1383, 13:34 عصر
اینها یه سری کامپوننت هستند که میشه افیس ارتباط کامل برقرار کرد
شرکت Turbo Power
اینها توضیحات هلپ اون کامپوننت هاست 8)

OfficePartner is a unique and powerful product designed to bridge the gap between VCL development and the COM automation servers available in Microsoft Office 97 and Office 2000. OfficePartner makes it easier for Delphi and C++Builder programmers to "reach into Office" in order to use the services it provides. The OfficePartner hierarchy isn’t just a wrapper around calls to Office applications. Rather, it’s a complete object-oriented framework that encapsulates the COM services so that you don’t really have to understand COM or Automation to use OfficePartner effectively.

OfficePartner has a number of components and classes that make working with Office easier, including:

· A component for automating Microsoft Word (TOpWord). Support classes give you full control over documents, including manipulating tables, using bookmarks, managing hyperlinks, performing mail merges, working with drawing objects, and more.

· A component for automating Microsoft Excel (TOpExcel). Through this component you can work with Excel workbooks and worksheets. Support classes allow you to manipulate cells (content, border style, fill pattern, font, and so on), cell ranges, hyperlinks, and charts.

· A component for automating Microsoft Outlook (TOpOutlook). This powerful component allows you to send and read e-mail messages, access the Contacts folder, manage tasks and appointments, work with journal items, access special Outlook folders, and more.

· A component for automating Microsoft PowerPoint (TOpPowerPoint). This component allows you to create and play slide shows, manage slide transitions and effects, and more.

· A VCL TDataSet descendant component (TOpContactsDataSet) that allows direct access to Outlook Contacts.

· A class to control the Office Assistant characters (TOpAssistant).

· Components for working with Excel ranges and Word selections as VCL data sets (
TOpEventModel and TOpDataSetModel).

vcldeveloper
چهارشنبه 23 اردیبهشت 1383, 00:57 صبح
شما لازم نیست که حتما از اون کامپوننت ها استفاده کنید.
در خود دلفی هم میشه با استفاده از Automation این کار رو انجام داد.

کد زیر یک تابع هست که یک فایل را در داخل MS-Word باز می کنه:


uses
ActiveX, ComObj, WordXP;

procedure TForm1.OpenWordDocument(FileName: string);
var
_vFileName : oleVariant; //Passes filename to Word
_vTrue : oleVariant; //Presents boolean True
_vFalse : oleVariant; //Presents boolean False
_vEmpty : oleVariant; //Presents empty string
_vFormat : oleVariant; //Passes document's format to Word

begin
//Initializing the Variant variables
_vTrue := True;
_vFalse := False;
_vEmpty := '';
_vFormat := wdOpenFormatAuto;

WordApp := CoWordApplication.Create;
WordApp.Visible := False;
WordApp.DisplayAlerts := wdAlertsNone;
_vFileName := FileName;
WordDoc :=WordApp.Documents.OpenOld(_vFileName,_vFalse,_vT rue,_vFalse,_vEmpty,_vEmpty,
_vFalse,_vEmpty,_vEmpty,_vFormat);
WordApp.Visible := True;
end;

spicirmkh
شنبه 26 شهریور 1384, 16:15 عصر
سلام

آقای کشاورز در مورد outlook برنامه هم دارید که از کامپونت outlookxp استفاده کنیم

majid1042
چهارشنبه 19 اردیبهشت 1386, 18:43 عصر
سلام
در ریپورت یکسری کامپوننت فیلتر وجود داره که اگه از اونها بتونیم استفاده کنیم به راحتی بدون هیچ گونه کد نویسی میشه اطلاعاتمون رو به صورت تکست ذخیره کرد ولی هر چه گشتم نتونستم qrexclefilter رو که می تونه ریپورت را به صورت فایلهای اکسل ذخیره کنه پیدا کنم اگه بتونید کمک کنید ممنون میشم

SYNDROME
چهارشنبه 19 اردیبهشت 1386, 20:51 عصر
با سلام
همه این راه حل ها خوب است.
ولی می خواستم بدونم کسی با Activex به نام OWC10.DLL کار کردید.
قدرتی این activeX که با خود Office نصب می شه مثال زدنی هست.
تا به حال هیچ کامپونتی رو با این قدرت ندیدم.
امکانات ActiveX:

سلول به سلول می توانید Ecel را رنگ کنید.
اطلاعاتی در حدود 100000رکورد را در کمتر از 20 ثانیه انتقال می دهد.
و . . .