I would like to start using WINWORD from FWH.
Do I have to use ActiveX or OLE?
Which libs do I have to include to use ActiveX from Harbour?
Thanks in advance
Otto
Otto wrote:I would like to start using WINWORD from FWH.
Do I have to use ActiveX or OLE?
Otto wrote:Which libs do I have to include to use ActiveX from Harbour?
// Using Microsoft Office Word ActiveX
#include "FiveWin.ch"
function Main()
local oWnd, oActiveX, cString
DEFINE WINDOW oWnd TITLE "FiveWin ActiveX Support"
if IsActivex( "Word.Application.8" )
cString := "Word.Application.8"
endif
if IsActivex( "Word.Application.9" )
cString := "Word.Application.9"
endif
if IsActivex( "Word.Application.10" )
cString := "Word.Application.10"
endif
if IsActivex( "Word.Application.11" )
cString := "Word.Application.11"
endif
if IsActivex( "Word.Application.12" )
cString := "Word.Application.12"
endif
oActiveX = TActiveX():New( oWnd, cString )
oWnd:oClient = oActiveX // To fill the entire window surface
ACTIVATE WINDOW oWnd
return nil
::oWord := CREATEOBJECT( "Word.Application" )
::oWord:Visible := .T. // if you want to see it
::oDocument := oWord:Documents:Add()
::oDocument:SaveAs( sFileName, WdFormatDocument ) // WdFormatDocument is a defined constant
::oRange := ::oDocument:Range( 0, 0 )
::oRange:InsertBefore( sDateAsText )
::oRange:ParagraphFormat:Alignment := WdAlignParagraphRight //WdAlignParagraphRight is a defined constant
::oRange:InsertParagraphAfter()
::iEnd := ::oRange:End
::oRange := ::oDocument:Range( ::iEnd, ::iEnd )
::oRange:InsertAfter( sGreeting )
::oRange:ParagraphFormat:Alignment := WdAlignParagraphLeft //WdAlignParagraphLeft is a defined constant
::oRange:InsertParagraphAfter()
::iEnd := ::oRange:End
::oRange:Bold := .T.
::oRange:FontName := "Arial"
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 79 guests