Click here to Skip to main content
15,897,891 members
Articles / Desktop Programming / MFC

Demonstration of OLE Automation of MS Word

Rate me:
Please Sign up or sign in to vote.
3.00/5 (8 votes)
24 Feb 20021 min read 145.8K   23K   38  
An article that demonstrates automation by showing how to split a MS-Word file based on Bookmarks
// Word1Dlg.h : header file
//

#if !defined(AFX_WORD1DLG_H__6ED6F1AA_1EE6_11D6_8CF8_00508B3519E4__INCLUDED_)
#define AFX_WORD1DLG_H__6ED6F1AA_1EE6_11D6_8CF8_00508B3519E4__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

class CWord1DlgAutoProxy;

/////////////////////////////////////////////////////////////////////////////
// CWord1Dlg dialog

class CWord1Dlg : public CDialog
{
	DECLARE_DYNAMIC(CWord1Dlg);
	friend class CWord1DlgAutoProxy;

// Construction
public:
	CWord1Dlg(CWnd* pParent = NULL);	// standard constructor
	virtual ~CWord1Dlg();

// Dialog Data
	//{{AFX_DATA(CWord1Dlg)
	enum { IDD = IDD_WORD1_DIALOG };
	CString	m_SourcePath;
	CString	m_DestinationPath;
	//}}AFX_DATA

	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CWord1Dlg)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:
	CWord1DlgAutoProxy* m_pAutoProxy;
	HICON m_hIcon;

	BOOL CanExit();

	// Generated message map functions
	//{{AFX_MSG(CWord1Dlg)
	virtual BOOL OnInitDialog();
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	afx_msg void OnClose();
	virtual void OnOK();
	virtual void OnCancel();
	afx_msg void OnEllipsis1();
	afx_msg void OnEllipsis2();
	afx_msg void OnSplitbutton();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_WORD1DLG_H__6ED6F1AA_1EE6_11D6_8CF8_00508B3519E4__INCLUDED_)

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
United States United States
A Developer from India. Concentrating on the Microsoft Technologies. VC++ and VB.


Comments and Discussions