From Heathrow Terminals 2&3, Terminal 4 or Terminal 5, take the Heathrow Connect Rail Train (not Tube) to the Hayes and Harlington station. Depart the train @ H&H and buy your rail tickets to Swindon at the ticket window; or online beforehand. See heathrowconnect.com website for train times from your Heathrow Terminal station to Hayes and Harlington station. Then, check Heathrow Connect train times from H&H to Swindon on thetrainline.com website that will work with your Heathrow Connect arrival.
What I see online today for train times is, for example:
Depart 14:42 from Hayes and Harlington (Great Western Railway) arriving @ Reading Station 15:21.
Detrain and Transfer to a different train leaving @15:28 from Reading, arriving Swindon @ 15:54. Looks like there is a train every 30 minutes or so during this part of the day. Check the train times; and I would buy an open ticket, not one that ties you to a specific time, to give you wiggle room for delays.
Allow AMPLE time for making your way to the underground railway station at Heathrow, talking to agents and getting directions, and buying tickets at the windows or in the machines; and you will have to haul your own baggage on and off each train. Pack accordingly. LOL Hope this helps. Have a wonderful time!