Dave Punky
Board Regular
- Joined
- Jan 7, 2010
- Messages
- 133
Hi all,
Hopefully somebody can help me with regards to this.
Basically I am wanting to create a full Word document on the press of a button basically within a userform in VBA. It transfers some of the information in said userform into the document, however that isn't the issue.
The word document I am trying to create has to include hyperlinks among other things and I was wondering what the best way of doing this was? When creating an email from Excel VBA you can do .HTMLBody which solves that problem as you just write it as a HTML line, but is there a way of doing this when transferring text into Word?
Basically to help explain what I'm trying to do, this is the information I have in my userform:
Reference Number: 12345
Name: Mr Smith
It basically needs to transfer the information into Word so it ends up like:
---
Dear Mr Smith,
With regards to reference 12345, something has happened. You can check the status here.
Regards.
Note: Here would be where the hyperlink is, to Google for example.
---
The idea is that it auto generates this and also saves it in a directory I've created. I've got it creating documents and saving these to the directory, its just the hyperlinks which are causing the problem and if I can format the whole thing in HTML I'll be plain sailing if that's possible. Obviously considering how little in actuality I'm doing, if there's a set of code with minimal actions for creating a Word document with this information then that would be of great benefit too.
Has anybody done this previously or knows how to do this? It would be a real benefit for me to know how to do this and save me about a million hours of copy/paste every day.
Many thanks.
Hopefully somebody can help me with regards to this.
Basically I am wanting to create a full Word document on the press of a button basically within a userform in VBA. It transfers some of the information in said userform into the document, however that isn't the issue.
The word document I am trying to create has to include hyperlinks among other things and I was wondering what the best way of doing this was? When creating an email from Excel VBA you can do .HTMLBody which solves that problem as you just write it as a HTML line, but is there a way of doing this when transferring text into Word?
Basically to help explain what I'm trying to do, this is the information I have in my userform:
Reference Number: 12345
Name: Mr Smith
It basically needs to transfer the information into Word so it ends up like:
---
Dear Mr Smith,
With regards to reference 12345, something has happened. You can check the status here.
Regards.
Note: Here would be where the hyperlink is, to Google for example.
---
The idea is that it auto generates this and also saves it in a directory I've created. I've got it creating documents and saving these to the directory, its just the hyperlinks which are causing the problem and if I can format the whole thing in HTML I'll be plain sailing if that's possible. Obviously considering how little in actuality I'm doing, if there's a set of code with minimal actions for creating a Word document with this information then that would be of great benefit too.
Has anybody done this previously or knows how to do this? It would be a real benefit for me to know how to do this and save me about a million hours of copy/paste every day.
Many thanks.