Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #7  
Old 08-18-2020, 04:03 AM
Boris_R Boris_R is offline Filling data with XML Windows Vista Filling data with XML Office 2010 32bit
Novice
 
Join Date: Oct 2015
Posts: 6
Boris_R is on a distinguished road
Default

Quote:
Originally Posted by Guessed View Post
Do you have an automated way to create the XML strings for charts created in other tools such as Excel or from screen captures? What method would you use to create these strings from a PNG filepath?
After running the macro, two mapped content controls will appear in your document.
These content controls are linked to the same node
Insert your picture into the "Picture" content control.
The string you are interested in will be in the Plain Text content control
Code:
Sub Two_Mapped_CC()
'
    Dim oCC As Word.ContentControl
    Dim oCustomPart As Office.CustomXMLPart
    Dim orng As Range
    Set oCustomPart = ActiveDocument.CustomXMLParts.Add("<ccMap><ccData></ccData></ccMap>")
    Set oCC = ActiveDocument.ContentControls.Add(wdContentControlPicture)
    With oCC
        .Title = "Picture"
        .XMLMapping.SetMapping "/ccMap/ccData[1]"
    End With
    Set orng = oCC.Range.Paragraphs(1).Range
    With orng
        .InsertParagraphAfter
        .InsertParagraphAfter
        .MoveEnd Unit:=wdCharacter, Count:=2
        .Start = orng.End
    End With
    Set oCC = orng.ContentControls.Add(wdContentControlText)
    With oCC
        .Title = "Str"
        .XMLMapping.SetMapping "/ccMap/ccData[1]"
    End With
    Set oCC = Nothing
    Set oCustomPart = Nothing
    Set orng = Nothing
Exit Sub
End Sub
Reply With Quote
 



Similar Threads
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
Filling data with XML matching data from one work sheet to another, then auto filling missing cell information timomaha Excel 1 09-12-2014 07:51 AM
Filling data with XML New to Excel - Filling out data The Accountant Excel 2 12-16-2013 12:32 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:14 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft