Question: I am making a little app in php which is putting text to image. I got it wotking with imagettftext. I was also able to put it to a imagettfbbox with specific width using this function <http://php.net/manual/en/function.imagettftext.php#89505>. My only problem is that I want the text to be aligned to the right side of the box like on the image![enter image description here](https://i.stack.imgur.com/g6T0L.png)

Answer: 
This should do the trick:

```
Sub Trigger_Email() 
    Dim rng As Range
    Dim rng2 As Range 
    Dim OutApp As Object 
    Dim OutMail As Object 
    Dim StrBody As String

    StrBody = "Hello Recruitment Team," & "<br>" & "<br>" & _
    "Please work on the below request details and open it for Vendor Sourcing. The details of the RRF are mentioned in the attachment." & "<br><br>"

    Set rng = Nothing
    On Error Resume Next
    'Only the visible cells in the selection
    'Set rng = Selection.SpecialCells(xlCellTypeVisible)
    'You can also use a fixed range if you want
    Set rng = Sheets("Sheet1").Range("A1:B20").SpecialCells(xlCellTypeVisible)
    Set rng2 = Sheets("Sheet1").Range("A33:B36").SpecialCells(xlCellTypeVisible)
    On Error GoTo 0

    If rng Is Nothing Then
        MsgBox "The selection is not a range or the sheet is protected" & _
               vbNewLine & "please correct and try again.", vbOKOnly
        Exit Sub
    End If

    With Application
        .EnableEvents = False
        .ScreenUpdating = False
    End With

    Set OutApp = CreateObject("Outlook.Application")
    Set OutMail = OutApp.CreateItem(0)

    On Error Resume Next

    With OutMail
        .To = "vinod.sn@wellsfargo.com;mamta.b.fajalia@wellsfargo.com"
        .CC = "G=EGS-IND-SC-Managers" & ";" & Cells(5, 2)
        .BCC = ""
        .Subject = "RRF for Vendor Sourcing - " & Cells(3, 2)
        .HTMLBody = StrBody & rangetoHTML(rng) & rangetoHTML(rng2)
        .Attachments.Add ActiveWorkbook.FullName
        .Display   'or use .Display
    End With
    On Error GoTo 0

    With Application
        .EnableEvents = True
        .ScreenUpdating = True
    End With

    Set OutMail = Nothing
    Set OutApp = Nothing
End Sub

```

Copy this sub and replace your original sub with it (the Function must be left untouched).

Your way of asking implies that you have no experience with VBA at all and just use this code. If you need to advance your code in any other way, I suggest you try to understand the code so you could make edits yourself. I'm just adding little fractions here which you could easily do by yourself.
```vb
Sub Macro2()

Dim LastRow As Double

LastRow = Cells.Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row

Range(Selection, Selection.End(xlToRight)).Select
    Range(Selection, Selection.End(xlDown)).Select

    Range("A1:AM" & LastRow).Select
    ActiveWorkbook.Worksheets(str).Sort.SortFields.Clear
    ActiveWorkbook.Worksheets(str).Sort.SortFields.Add Key:= _
        Range("G2:G" & LastRow), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption _
        :=xlSortNormal
    With ActiveWorkbook.Worksheets(str).Sort
        .SetRange Range("A1:AM" & LastRow)
        .Header = xlYes
        .MatchCase = False
        .Orientation = xlTopToBottom
        .SortMethod = xlPinYin
        .Apply
    End With
    Range("A1").Select
    ActiveWorkbook.Save
    ActiveWorkbook.Close
    Workbooks("Data Send").Activate
End Sub

```