Options

Problem with MS Word Automation

FalcFalc Member Posts: 6
Hi all,

I ´ve a little problem with MS Word Automation. I searched the forum, but did not find anything to solve my little problem. Please Help:

The litte thing i want to do, is tell word to change the allignment from left to center (or right, whatever).
It´s no problem to write in Word, but only at the left side... :(

Can you help, plz!

Comments

  • markborgesmarkborges Member Posts: 170
    Do you know how to execute Macros on Word? Do you know how to record and see a Macro's code in VBA for Word?

    When I want to do some automation on Word, I usually record the required steps on Word, and then just replicates the code in Navision.

    :wink:
    Marcelo Borges
    D365 Business Central Solutions Architect
    BC AL/NAV C/AL Developer
    BC Repositories.com
  • NaviSLNaviSL Member Posts: 1
    Hi Falc,

    with the Macros of Word you can do such anything. For example your problem. The solution is:
    Selection.ParagraphFormat.Alignment := 1;
    

    Now your text is in the middle of the word document. If you want to write the text to the right side you must copy this code:
    Selection.ParagraphFormat.Alignment := 2;
    

    I hope this little code will help you.

    With kind reqards
    NaviSL
Sign In or Register to comment.