The return value is a transaction number.
The Write method is synchronous/blocking, so it will only return after the successful write. If the write fails, it should throw an exception.
You can also handle the ComError event to be notified when there is an error.