Embed xml file in doc (openXML archive) using vba

Posted on 2009-04-23
Last Modified: 2012-05-06
I'm creating an addin for MS Word and i want to add/embed a file to the OXML structure
in the DocumentBeforeSave() event.
I don't know if it's possible to do such a thing from word!?

Sub DocumentBeforeSave()
  Doc.EmbedFile("c:\myfile.xml") ' If possible also specify where in archive to embed
End sub
Question by:dagi79
    1 Comment
    LVL 12

    Accepted Solution

    I think the following 2 links will give you the resources that you need:

    Word Developer Portal

    Manipulating Word 2007 Files with the Open XML Format API

    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    Join & Write a Comment

    No matter the version of Windows you are using, you may have some problems with Windows Search running too slow or possibly not running at all. Before jumping into how you can solve this issue, just know there are many other viable alternative deskt…
    My experience with Windows 10 over a one year period and suggestions for smooth operation
    This video shows where to find templates, what they are used for, and how to create and save a custom template using Microsoft Word.
    The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now