Export XML and send via email

nikoko

New member
Local time
Today, 08:26
Joined
Oct 1, 2006
Messages
4
I have a database written in 2003 and I am trying to export an XML file so that it attaches to an email automatically when the database opens. I have found a macro to Email a database object ... but not an XML file. I also know that on right clicking a query I can export it as an XML file.

Does anyone know if I can write a module or something that will email an xml file on an event e.g. when the database opens?

Any help would be very much appreciated
 
the docmd.sendobject allows you to send reports, queties, tables, etc. via email.
It covers a few different formats but not as far as I remember XML.
However, you can programatically export xml to a file using the ExportXML command.

Here's a quick snipet from MSTechNet as an example:
Code:
Const acExportTable = 0

Set objAccess = CreateObject("Access.Application")
objAccess.OpenCurrentDatabase "C:\Scripts\Test.mdb"
objAccess.ExportXML acExportTable,"Inventory","c:\scripts\test.xml"

I'd suggest looking into using this to output the xml to a temporary file, and then code to either attach it to an email or use it as the body of your message (if that's what you're after).
 
Thanks Ozinm

I have now managed to output an xml file to a specified folder.

I am now struggling for code to attach this to an email - especially as the users my well have different email programs

Nikki
 

Users who are viewing this thread

Back
Top Bottom