RJHarvey72
asked on
Looking for VBA code to insert a document (from a word template) with margins/formatting intact
It's probably easier if I explain why I want this and why I'm not just simply double clicking on the .dot file and then copying and pasting.
We have a system that will generate a blank document however this document is already 'linked' to save into exactly the right place within our document management system.
What I'd like is as follows. With the blank document open the typist will run a macro that will allow them to browse to our styles/templates directory where they will pick the correct word template and then the full contents of this will be inserted into the blank document. It needs to be exactly the same, so margins, styles etc etc Styles should be fine as it will be the same normal.dot for both the blank document and the document produced from the template.
So in basic terms we've replaced the blank document with the document produced from the word template.
I hope this makes sense but if not then just let me know and I'll try to clarify.
Thanks
We have a system that will generate a blank document however this document is already 'linked' to save into exactly the right place within our document management system.
What I'd like is as follows. With the blank document open the typist will run a macro that will allow them to browse to our styles/templates directory where they will pick the correct word template and then the full contents of this will be inserted into the blank document. It needs to be exactly the same, so margins, styles etc etc Styles should be fine as it will be the same normal.dot for both the blank document and the document produced from the template.
So in basic terms we've replaced the blank document with the document produced from the word template.
I hope this makes sense but if not then just let me know and I'll try to clarify.
Thanks
ASKER
Graham,
Thanks very much for this. I won't have a chance to try this until Monday but will let you know how I get on.
Richard
Thanks very much for this. I won't have a chance to try this until Monday but will let you know how I get on.
Richard
ASKER
Graham,
We've had a test at this and it brings everything across except the margins. If we can get them then that will be perfect. One other thing that would be ideal would be if we could set the directory that the users starts browsing for the templates in if that is possible.
Thanks very much for your help on this I think we are almost there.
Kind regards
Richard
We've had a test at this and it brings everything across except the margins. If we can get them then that will be perfect. One other thing that would be ideal would be if we could set the directory that the users starts browsing for the templates in if that is possible.
Thanks very much for your help on this I think we are almost there.
Kind regards
Richard
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Graham,
Thanks very much for this. I have pretty basic VB skills so I'm struggling to incorporate the two new pieces of code into the main part you kindly provided.
I've tried tinkering about with it but I'm not able to get it to work.
Thanks again for your help much appreciated.
Richard
Thanks very much for this. I have pretty basic VB skills so I'm struggling to incorporate the two new pieces of code into the main part you kindly provided.
I've tried tinkering about with it but I'm not able to get it to work.
Thanks again for your help much appreciated.
Richard
Open in new window