![]() |
|
#1
|
||||
|
||||
![]()
You are using nodes and attributes rather than simply nodes but the end game is essentially the same. I'm not sure if English is your first language but I didn't quite understand what you are asking.
Do you need to know how to embed the xml file into a document or are you asking how to make the attribute editable inside the Word document? Are you doing this purely with VBA or do you want to use the Word GUI to achieve the end game? Note that the 'image' file type is actually a string. You won't be able to include a PNG image in a text only format which is necessary for xml.
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
#2
|
|||
|
|||
![]()
Sorry, English is not my first language...
The goal is to insert datas (stored in an xml file) in the document with a userform. Data should not be editable in the document ! The only way to change the data is to use a new version of the associated node in the xml file. In my actual development, i can read an xml file and generate the treeview in the userform. But i don't know how to insert this data in the document while keeping a link with this data for future update with a new version. By the way, at the word closure i'm only able to store the xml path (ActiveDocument.Variables.Add) rather than the xml object... I hope it will clarify my needs. |
#3
|
|||
|
|||
![]() Quote:
After running the code, a "Red Square" will appear in the document Code:
Sub Add_Picture() Dim oCC As Word.ContentControl Dim oCustomPart As Office.CustomXMLPart Set oCC = ActiveDocument.ContentControls.Add(wdContentControlPicture) Set oCustomPart = ActiveDocument.CustomXMLParts.Add("<ccMap><ccData>iVBORw0KGgoAAAANSUhEUgAAADAAAAAmCAIAAAAN749WAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAScwAAEnMBjCK5BwAAAHNJREFUWEftmLEJwDAMBJU9Umb/zbKDE1BjjLkukeCMum+e86nRcZ9XlHpPoVITpdq832UhMKQPoW82bxVmS8hC6ZaEZhV0iFZDQhIiApTrkISIAOU6JCEiQLkOSYgIUK5DEiIClHd26K8zTZ/rh4Ty2DAAkMHKNHSz0cwAAAAASUVORK5CYII=</ccData></ccMap>") With oCC .Title = "Picture" .XMLMapping.SetMapping "/ccMap/ccData[1]" End With Exit Sub End Sub |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Filling in cells based on 2 other cells data | Dawindle | Excel | 4 | 11-10-2018 07:40 AM |
filling in blank cells with data from cell above | RayK | Excel | 1 | 01-12-2017 04:14 PM |
Wierd... "cell" started auto filling with data from other cells I double click on. How stop it?! | KerryOn | Excel | 2 | 08-10-2015 08:41 PM |
![]() |
timomaha | Excel | 1 | 09-12-2014 07:51 AM |
![]() |
The Accountant | Excel | 2 | 12-16-2013 12:32 PM |