Take a train from Venice Santa Lucia to Ljubljana. There are 2 a day and the journey is usually 4 hours. Alternatively take the train to Trieste in Italy and get the bus from there. There is even a better and quicker way. There exists Ferry Crossing Venice to Izola with the Prince of Venice and Vice Versa. This is a great 2-3 hour trip with fantastic views.