VB code for indenting text 3 spaces

  • How do I change the code below to create a 3 space indent to the Name within the paragraph?


    I'm not sure what should be typed above the .typetext Text:=Name

  • Re: VB code for indenting text 3 spaces


    You can either increase the Left indent or type 3 spaces. The former is preferable as the spaces will not be of equal pitch depending in the font/bold attributes of the text.



    That is assuming that 'Country', 'State' and 'City' are defined variables in your application.


    You (probably) should also include a 'TypeParagraph' after entering each variable, otherwise the text is concatenated on one line.


    Last point: Selection is a property of the Application object, so unless you have a

    Code
    With Application


    prior to the code you posted, the line

    Code
    With .Selection

    will raise an error.

  • Re: VB code for indenting text 3 spaces


    Thank you. I tried this below and when it cycled through the output to a word doc did what I wanted.


    .typetext Text:" "+Name

  • Re: VB code for indenting text 3 spaces


    Yes Patel, it's an excel macro with output to a word doc... I think it's working the way it needs to now for the final output...........you folks are great with your help to us newbies!

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!