Fromlostdays1
New Member
- Joined
- Jul 18, 2022
- Messages
- 14
- Office Version
- 365
- Platform
- Windows
Preamble:
I write legal contracts that are mostly the same between customers, but have variables the customer can elect, which in the contract will take the form of a sentence or paragraph change. I created a Word template with EVERY POSSIBLE permutation of language, and then bookmarked the variable sections. To create a contract now, I just open the template and manually delete all the variable language which does not apply to a particular customer. I also created a GUI in Excel that captures the Group's elections in a simple format. It looks like Customer Elected This: Yes.
The next logical step for me is to use that GUI to, once all the elections are made in Excel, to automatically open the Word template, and read each election from Excel and automatically delete the bookmarks (and enclosed text within them) based on those elections. Because I have every permutation of language in the Word template, this would (maybe thankfully) only be a process of deleting text and not adding any. I've tried to sort this out myself but beyond the little GUI I haven't been able to piece together exactly what I need from searching.
Requirements:
A button at the end of the Excel GUI called "Finalize" that when pressed will:
(A1: Yes) = Ignore Bookmark1
(A1: No) = Delete Bookmark1
Save both the Excel Document with all the elections and the Word document with the relevant text deleted. That's basically it. It feels like a lot to ask but I've been trying to sort this out myself for a couple weeks now and I can't seem to get it right. Also, if anyone reading this has an idea for better methodology in general, I'm open to that too.
Thanks so much for any advice!
I write legal contracts that are mostly the same between customers, but have variables the customer can elect, which in the contract will take the form of a sentence or paragraph change. I created a Word template with EVERY POSSIBLE permutation of language, and then bookmarked the variable sections. To create a contract now, I just open the template and manually delete all the variable language which does not apply to a particular customer. I also created a GUI in Excel that captures the Group's elections in a simple format. It looks like Customer Elected This: Yes.
The next logical step for me is to use that GUI to, once all the elections are made in Excel, to automatically open the Word template, and read each election from Excel and automatically delete the bookmarks (and enclosed text within them) based on those elections. Because I have every permutation of language in the Word template, this would (maybe thankfully) only be a process of deleting text and not adding any. I've tried to sort this out myself but beyond the little GUI I haven't been able to piece together exactly what I need from searching.
Requirements:
A button at the end of the Excel GUI called "Finalize" that when pressed will:
- Open the Word Template. (Extra) It would be excellent if the code duplicated the Word template and opened the duplicate so I never have to worry about losing the original, but I can make sure to keep a fresh one filed away so this isn't completely necessary.
- Search for a specific cell in Excel and match with particular bookmark and either ignore or delete the bookmark and enclosed text depending on what it finds
(A1: Yes) = Ignore Bookmark1
(A1: No) = Delete Bookmark1
Save both the Excel Document with all the elections and the Word document with the relevant text deleted. That's basically it. It feels like a lot to ask but I've been trying to sort this out myself for a couple weeks now and I can't seem to get it right. Also, if anyone reading this has an idea for better methodology in general, I'm open to that too.
Thanks so much for any advice!