Another Excel-question

Another Excel-question

Postby driessen » Thu Nov 05, 2020 5:38 pm

Hello,

How can I define a tabstop in a Word document in my FWH-application?

Thank you.
Regards,

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.07 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773
User avatar
driessen
 
Posts: 1422
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Re: Another Excel-question

Postby alerchster » Thu Nov 05, 2020 7:12 pm

Code: Select all  Expand view
#include "FiveWin.ch"

#define wdDoNotSaveChanges                      0

//Tab Alignment
#define wdAlignTabBar               4   //Bar
#define wdAlignTabCenter            1   //Center
#define wdAlignTabDecimal           3   //Decimal
#define wdAlignTabLeft              0   //Left
#define wdAlignTabList              6   //List
#define wdAlignTabRight             2   //Right

//Tab Leader
#define wdTabLeaderDashes           2   //Dashes
#define wdTabLeaderDots             1   //Dots
#define wdTabLeaderHeavy            4   //A heavy line
#define wdTabLeaderLines            3   //Double lines
#define wdTabLeaderMiddleDot        5   //A middle dot
#define wdTabLeaderSpaces           0   //Spaces default


FUNCTION MAIN()
        LOCAL   oWord, oDoc, oSelection

        TRY
                oWord := TOleAuto():New( "Word.Application" )
        CATCH
                oWord := NIL
        END

        IF oWord <> NIL
                oDoc := oWord:Documents:Add()

                oWord:Visible := .T.

                oSelection := oWord:Selection()

                oSelection:TypeText( "This is my text in Word!" )

                //delete tabs
                //Selection.ParagraphFormat.TabStops.ClearAll
                oSelection:ParagraphFormat:TabStops:ClearAll()
               
                //make tabs
                //oSelection:ParagraphFormat:TabStops:Add(Position in Points, Alignment, Leader)
                oSelection:ParagraphFormat:TabStops:Add(100, wdAlignTabLeft, wdTabLeaderSpaces)
                oSelection:ParagraphFormat:TabStops:Add(200, wdAlignTabRight, wdTabLeaderSpaces)
                oSelection:ParagraphFormat:TabStops:Add(300, wdAlignTabDecimal, wdTabLeaderSpaces)


                //oWord:Visible := .F.

                //oDoc:Close( wdDoNotSaveChanges )

                //oWord:Quit()

        ENDIF
RETURN NIL
Regards

Ing. Anton Lerchster
User avatar
alerchster
 
Posts: 91
Joined: Mon Oct 22, 2012 4:43 pm

Re: Another Excel-question

Postby driessen » Thu Nov 05, 2020 7:51 pm

Thank you very much.
Regards,

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.07 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773
User avatar
driessen
 
Posts: 1422
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 19 guests