I am using VBA to create a word document (.docx). This word document contains plain text content controls as well as picture content controls. I then use VBA to automatically select a picture based on the code below
After the pictures are inserted via my code I save the document using
After the document has been closed down I try to open it again and I am told "The file cannot be opened because there are problems with the contents."
When I click details it says "Unspecified error" and "Location: Part: /word/document.xml, Line: 2, Column: 0"
If I click ok it says "Word found unreadable content in "". Do you want to recover the contents of this document? If you turst the source of this document, click Yes.
Clicking Yes opens the document with all the contents and it is now renamed to Document 1. If I click no it does not open.
Please help as I am almost done with my code, just confused why the picture content controls are giving me problems. I can insert the pictures into the content controls manually and I get no errors saving but doing it from VBA gives unreadable content. I have read some about xml stuff but I have no idea what they are talking about. Thanks so much!