Horizontal alignment text google Script

14 views
Skip to first unread message

Flotte FLOTTE

unread,
Mar 9, 2020, 8:38:53 AM3/9/20
to Google Apps Script Community

Hi all,

I'm working on a script that edits an invoice using data from a spreadsheet. The initial script works. I am now trying to change the layout. At the moment, everything that is created is aligned to the left, I am trying to set some information to a right align. I've tried to use .setAlignment(DocumentApp.HorizontalAlignment.RIGHT) but it won't work as RIGHT is not defined according to the error code.

I am a beginner coding wise so I'm really stuck.

You can find my code in attached files (I should actually say someone else codes that I've used and modified a little, but I don't remember the source).

 Thank you very much

Capture d’écran 2020-03-09 à 12.40.34.png

Alex

unread,
Mar 9, 2020, 1:14:52 PM3/9/20
to Google Apps Script Community

Flotte FLOTTE

unread,
Mar 9, 2020, 3:33:18 PM3/9/20
to google-apps-sc...@googlegroups.com

--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/70ab628b-ecd1-45bf-948c-9582d4811799%40googlegroups.com.

Alex

unread,
Mar 9, 2020, 3:50:19 PM3/9/20
to Google Apps Script Community
OK.

You can do something like this

body.appendParagraph("KVAR LOCATION").setAlignment(DocumentApp.HorizontalAlignment.RIGHT);

Best


On Monday, March 9, 2020 at 10:33:18 PM UTC+3, Flotte FLOTTE wrote:
Le lun. 9 mars 2020 à 18:15, Alex <oshl...@gmail.com> a écrit :
Hi Flotte!


Could you share a real sample (not a pic)?

Best, Alex.

On Monday, March 9, 2020 at 3:38:53 PM UTC+3, Flotte FLOTTE wrote:

Hi all,

I'm working on a script that edits an invoice using data from a spreadsheet. The initial script works. I am now trying to change the layout. At the moment, everything that is created is aligned to the left, I am trying to set some information to a right align. I've tried to use .setAlignment(DocumentApp.HorizontalAlignment.RIGHT) but it won't work as RIGHT is not defined according to the error code.

I am a beginner coding wise so I'm really stuck.

You can find my code in attached files (I should actually say someone else codes that I've used and modified a little, but I don't remember the source).

 Thank you very much

--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-community+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages