Hello forum!
I have tried to patch together a macro that will perform specific tasks from a list I have made, but I was not able to make sense of it. So I've decided to rather just paste the list here and kindly ask for some guidance from you and perhaps some of you are able to come up with a solution.
I have an open Excel-workbook and need an Excel-macro there that will open a specific document in Word (not necessarily a Word-document), then use a Word-macro to perform some editing before saving, closing and returning to Excel. This is the complete task list:
1. From an Excel-workbook, open a Word-document with a defined file path and title "...\Document.doc" and accept/OK any alert messages
2. Search document for shapes (objects, pictures) that contain the alternative text (Alt Text) "\Alt1.gif" or "\Alt2.gif"
3. Write the Alt Texts in the same positions that their respective shapes are anchored
4. Delete all shapes (objects, pictures) in the document
5. For all tables in the document (if any), delete empty rows (if any)
6. Replace the word "Word1" with "Word1^pWord2" (^p to enter a paragraph between the words) throughout the document
7. If the document contains a table that has a column in which the heading (first cell of the column) contains the word "Word1^pWord2", then use Split Cells to split that column (2 columns, 1 row, do not merge cells before split)
8. Replace the word "Word3" with "^pWord3" (^p to enter a paragraph between the words) throughout the document
9. Replace the word "Word4" with "^p" (^p to enter a paragraph) throughout the document
10. If the document contains a table that has a column in which the heading (first cell of the column) contains the word "Word5", then use Split Cells to split that column (2 columns, 1 row, do not merge cells before split)
11. Replace the word "Word1^pWord2" (^p to enter a paragraph between the words) with "Word1" throughout the document
12. Replace "^I" (manual line breaks) with "space/space" throughout the document
13. Save and close the Word-document, return to Excel-workbook
Any help will be appreciated!
Best regards,
Marbleking
Bookmarks