| |

VerySource

 Forgot password?
 Register
Search
View: 2080|Reply: 1

Where is the help documentation for Office development in MSDN?

[Copy link]

1

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-1-3 17:20:01
| Show all posts |Read mode
The program needs to add a new feature: writing data to EXCEL documents, requiring Office Automation instead of ODBC.
I found some sample code for this in the internet:

        // TODO: Add your control notification handler code here
_Application ExcelApp;
Workbooks wbsMyBooks;
_Workbook wbMyBook;
Worksheets wssMysheets;
_Worksheet wsMysheet;
Range rgMyRge;
// Create Excel 2000 server (start Excel)
if (! ExcelApp.CreateDispatch ("Excel.Application", NULL))
{
AfxMessageBox ("Failed to create Excel service!");
exit (1);
}
ExcelApp.SetVisible (false);
// Create a new document using a template file
char path [MAX_PATH];
GetCurrentDirectory (MAX_PATH, path);
CString strPath = path;
strPath + = "\\template1";
wbsMyBooks.AttachDispatch (ExcelApp.GetWorkbooks (), true);
wbMyBook.AttachDispatch (wbsMyBooks.Add (_variant_t (strPath)));
         ...
         ...

May I ask: _Application :: CreateDispatch (), _Application :: SetVisible (), _Workbook :: AttachDispatch, etc., what kind of functions do they implement? What is the parameter list? How can I not find help on them in MSDN?
Reply

Use magic Report

0

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-3-3 10:00:01
| Show all posts
CreateDispatch, AttachDispatch should be the interface of com.
SetVisible is an interface to excel.
Msdn2003 doesn't seem to be there.
Because there is a vsto in vs2005.
So msdn2005 also has more documentation about vsto.
Development Tools and Languages-> Visual Studio Documents-> Visual Studio Tools for Office Documents-> Reference Information-> Microsoft Office Excel Primary Interop Reference
Although it is for vsto., The hierarchy, method attributes and com are exactly the same.
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list