A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Creating a custom text export file (inc. header & footer) from a q



 
 
Thread Tools Display Modes
  #1  
Old May 10th, 2007, 06:35 PM posted to microsoft.public.access.externaldata,microsoft.public.access.reports,microsoft.public.access
efandango
external usenet poster
 
Posts: 489
Default Creating a custom text export file (inc. header & footer) from a q

I have an address query which ouputs a single field to text strings for
Google Earth .kml file format parameters.

The problem is that the .kml file requires a header and footer text to be
inserted. Does anyone know how I can pre-insert the Header and Footer into a
standard text file, and then save it with a ‘.kml’ extension, for example
‘Addresses.kml’

This is the Header:

?xml version="1.0" encoding="UTF-8"?
kml xmlns="http://earth.google.com/kml/2.0"
Document
nameAddress List/name
Folder
nameLocations/name
open1/open

Output Field: [kml Address]

This is the Footer:

/Folder
/Document
/kml

Ads
  #2  
Old May 10th, 2007, 09:01 PM posted to microsoft.public.access.externaldata,microsoft.public.access.reports,microsoft.public.access
Tom Ventouris
external usenet poster
 
Posts: 186
Default Creating a custom text export file (inc. header & footer) from a q

Search for this text in this group: "Export to File.Dat"
You will find the helpful answer I got from Ken Snell on renaming your
exported text file.


"efandango" wrote:

I have an address query which ouputs a single field to text strings for
Google Earth .kml file format parameters.

The problem is that the .kml file requires a header and footer text to be
inserted. Does anyone know how I can pre-insert the Header and Footer into a
standard text file, and then save it with a ‘.kml’ extension, for example
‘Addresses.kml’

This is the Header:

?xml version="1.0" encoding="UTF-8"?
kml xmlns="http://earth.google.com/kml/2.0"
Document
nameAddress List/name
Folder
nameLocations/name
open1/open

Output Field: [kml Address]

This is the Footer:

/Folder
/Document
/kml

  #3  
Old May 10th, 2007, 09:21 PM posted to microsoft.public.access.externaldata,microsoft.public.access.reports,microsoft.public.access
John Nurick
external usenet poster
 
Posts: 492
Default Creating a custom text export file (inc. header & footer) from a q

There are many ways of skinning this cat. I'd probably do something like
this (air code):

Dim rsR As DAO.Recordset
Dim strLine As String
Dim lngFN As Long

'Create empty text file
lngFN = FreeFile()
Open "D:\Folder\Addresses.kml" For Output As #lngFN

'Output header
'NB: need to double quotes in literal strings
Print #lngFN, "?xml version="1.0" encoding=""UTF-8""?"
Print #lngFN, "kml xmlns=""http://earth.google.com/kml/2.0"""
'...

'Output address
Set rsR = CurrentDB.Open("My Query")
Print #lngFN, rsR.Fields("kml Address")
Close rsR

'Output footer
Print #lngFN blah blah

Close #lngFN

On Thu, 10 May 2007 10:35:01 -0700, efandango
wrote:

I have an address query which ouputs a single field to text strings for
Google Earth .kml file format parameters.

The problem is that the .kml file requires a header and footer text to be
inserted. Does anyone know how I can pre-insert the Header and Footer into a
standard text file, and then save it with a .kml extension, for example
Addresses.kml

This is the Header:

?xml version="1.0" encoding="UTF-8"?
kml xmlns="http://earth.google.com/kml/2.0"
Document
nameAddress List/name
Folder
nameLocations/name
open1/open

Output Field: [kml Address]

This is the Footer:

/Folder
/Document
/kml


--
John Nurick [Microsoft Access MVP]

Please respond in the newsgroup and not by email.
  #4  
Old May 10th, 2007, 10:07 PM posted to microsoft.public.access.externaldata,microsoft.public.access.reports,microsoft.public.access
efandango
external usenet poster
 
Posts: 489
Default Creating a custom text export file (inc. header & footer) from

John,

thanks for your reply. I must confess it seems a little 'hardcore' for a
novice such as me. Can you walk me through the broad points of the syntax
used?


"John Nurick" wrote:

There are many ways of skinning this cat. I'd probably do something like
this (air code):

Dim rsR As DAO.Recordset
Dim strLine As String
Dim lngFN As Long

'Create empty text file
lngFN = FreeFile()
Open "D:\Folder\Addresses.kml" For Output As #lngFN

'Output header
'NB: need to double quotes in literal strings
Print #lngFN, "?xml version="1.0" encoding=""UTF-8""?"
Print #lngFN, "kml xmlns=""http://earth.google.com/kml/2.0"""
'...

'Output address
Set rsR = CurrentDB.Open("My Query")
Print #lngFN, rsR.Fields("kml Address")
Close rsR

'Output footer
Print #lngFN blah blah

Close #lngFN

On Thu, 10 May 2007 10:35:01 -0700, efandango
wrote:

I have an address query which ouputs a single field to text strings for
Google Earth .kml file format parameters.

The problem is that the .kml file requires a header and footer text to be
inserted. Does anyone know how I can pre-insert the Header and Footer into a
standard text file, and then save it with a ‘.kml’ extension, for example
‘Addresses.kml’

This is the Header:

?xml version="1.0" encoding="UTF-8"?
kml xmlns="http://earth.google.com/kml/2.0"
Document
nameAddress List/name
Folder
nameLocations/name
open1/open

Output Field: [kml Address]

This is the Footer:

/Folder
/Document
/kml


--
John Nurick [Microsoft Access MVP]

Please respond in the newsgroup and not by email.

  #5  
Old May 10th, 2007, 10:19 PM posted to microsoft.public.access.externaldata,microsoft.public.access.reports,microsoft.public.access
efandango
external usenet poster
 
Posts: 489
Default Creating a custom text export file (inc. header & footer) from

John,

I have 'filled in' your code to thus far:

Private Sub Test_Click()
Dim rsR As DAO.Recordset
Dim strLine As String
Dim lngFN As Long

'Create empty text file
lngFN = FreeFile()
Open "D:\Folder\Addresses.kml" For Output As #lngFN

'Output header
'NB: need to double quotes in literal strings
Print #lngFN, "?xml version="; 1#; " encoding=""UTF-8""?"
Print #lngFN, "kml xmlns=""http://earth.google.com/kml/2.0"""
'...

'Output address
Set rsR = CurrentDb.Open("Generate KML")
Print #lngFN, rsR.Fields("KML_Address")
Close rsR

'Output footer
Print #lngFN blah blah

Close #lngFN

End Sub


But I am stuck on the Header and Footer:

What do I call them?; just header.txt footer.txt. do i put the full path in?

D:\folder\header.txt

and how do i get them to insert into the 'Addresses.kml' file?




"John Nurick" wrote:

There are many ways of skinning this cat. I'd probably do something like
this (air code):

Dim rsR As DAO.Recordset
Dim strLine As String
Dim lngFN As Long

'Create empty text file
lngFN = FreeFile()
Open "D:\Folder\Addresses.kml" For Output As #lngFN

'Output header
'NB: need to double quotes in literal strings
Print #lngFN, "?xml version="1.0" encoding=""UTF-8""?"
Print #lngFN, "kml xmlns=""http://earth.google.com/kml/2.0"""
'...

'Output address
Set rsR = CurrentDB.Open("My Query")
Print #lngFN, rsR.Fields("kml Address")
Close rsR

'Output footer
Print #lngFN blah blah

Close #lngFN

On Thu, 10 May 2007 10:35:01 -0700, efandango
wrote:

I have an address query which ouputs a single field to text strings for
Google Earth .kml file format parameters.

The problem is that the .kml file requires a header and footer text to be
inserted. Does anyone know how I can pre-insert the Header and Footer into a
standard text file, and then save it with a ‘.kml’ extension, for example
‘Addresses.kml’

This is the Header:

?xml version="1.0" encoding="UTF-8"?
kml xmlns="http://earth.google.com/kml/2.0"
Document
nameAddress List/name
Folder
nameLocations/name
open1/open

Output Field: [kml Address]

This is the Footer:

/Folder
/Document
/kml


--
John Nurick [Microsoft Access MVP]

Please respond in the newsgroup and not by email.

  #6  
Old May 11th, 2007, 12:41 AM posted to microsoft.public.access.externaldata,microsoft.public.access.reports,microsoft.public.access
efandango
external usenet poster
 
Posts: 489
Default Creating a custom text export file (inc. header & footer) from

John,

Just ignore the previous two posts from me.

This is how far i have got in adapting your code

Private Sub Test_Click()
Dim rsR As DAO.Recordset
Dim strLine As String
Dim lngFN As Long

'Create empty text file
lngFN = FreeFile()
Open "W:\Folder\Addresses.kml" For Output As #lngFN

'Output header
'NB: need to double quotes in literal strings
Print #lngFN, "?xml version="; 1#; " encoding=""UTF-8""?"
Print #lngFN, "kml xmlns=""http://earth.google.com/kml/2.0"""
Print #lngFN, "Document"
Print #lngFN, "nameAddress List/name"
Print #lngFN, "Folder"
Print #lngFN, "nameLocations/name"
Print #lngFN, "open1/open"
'...

'Output address
Set rsR = CurrentDb.Open("Generate_KML")
Print #lngFN, rsR.Fields("KML_Address")
Close rsR

'Output footer
Print #lngFN, "/Folder"
Print #lngFN, "/Document"
Print #lngFN, "/kml"
'...

Close #lngFN

End Sub


But i get an error message: 'Method or Data Member not found' on the word
'Open' in the following line:

Set rsR = CurrentDb.Open("Generate_KML")

It suggests that something is mispelled or wrong reference, so I was worried
that the query it was calling was two seperate words, so I changed it to one
whole_word. But it still reports the same error message.

Can you help me with this?

"John Nurick" wrote:

There are many ways of skinning this cat. I'd probably do something like
this (air code):

Dim rsR As DAO.Recordset
Dim strLine As String
Dim lngFN As Long

'Create empty text file
lngFN = FreeFile()
Open "D:\Folder\Addresses.kml" For Output As #lngFN

'Output header
'NB: need to double quotes in literal strings
Print #lngFN, "?xml version="1.0" encoding=""UTF-8""?"
Print #lngFN, "kml xmlns=""http://earth.google.com/kml/2.0"""
'...

'Output address
Set rsR = CurrentDB.Open("My Query")
Print #lngFN, rsR.Fields("kml Address")
Close rsR

'Output footer
Print #lngFN blah blah

Close #lngFN

On Thu, 10 May 2007 10:35:01 -0700, efandango
wrote:

I have an address query which ouputs a single field to text strings for
Google Earth .kml file format parameters.

The problem is that the .kml file requires a header and footer text to be
inserted. Does anyone know how I can pre-insert the Header and Footer into a
standard text file, and then save it with a ‘.kml’ extension, for example
‘Addresses.kml’

This is the Header:

?xml version="1.0" encoding="UTF-8"?
kml xmlns="http://earth.google.com/kml/2.0"
Document
nameAddress List/name
Folder
nameLocations/name
open1/open

Output Field: [kml Address]

This is the Footer:

/Folder
/Document
/kml


--
John Nurick [Microsoft Access MVP]

Please respond in the newsgroup and not by email.

  #7  
Old May 11th, 2007, 06:10 AM posted to microsoft.public.access.externaldata,microsoft.public.access.reports,microsoft.public.access
John Nurick
external usenet poster
 
Posts: 492
Default Creating a custom text export file (inc. header & footer) from

My fault - though I warned you it was air code. Should be
CurrentDB.OpenRecordset("Generate_KML", dbOpenSnapshot)
not
CurrentDB.Open("Generate_KML")




On Thu, 10 May 2007 16:41:00 -0700, efandango
wrote:

John,

Just ignore the previous two posts from me.

This is how far i have got in adapting your code

Private Sub Test_Click()
Dim rsR As DAO.Recordset
Dim strLine As String
Dim lngFN As Long

'Create empty text file
lngFN = FreeFile()
Open "W:\Folder\Addresses.kml" For Output As #lngFN

'Output header
'NB: need to double quotes in literal strings
Print #lngFN, "?xml version="; 1#; " encoding=""UTF-8""?"
Print #lngFN, "kml xmlns=""http://earth.google.com/kml/2.0"""
Print #lngFN, "Document"
Print #lngFN, "nameAddress List/name"
Print #lngFN, "Folder"
Print #lngFN, "nameLocations/name"
Print #lngFN, "open1/open"
'...

'Output address
Set rsR = CurrentDb.Open("Generate_KML")
Print #lngFN, rsR.Fields("KML_Address")
Close rsR

'Output footer
Print #lngFN, "/Folder"
Print #lngFN, "/Document"
Print #lngFN, "/kml"
'...

Close #lngFN

End Sub


But i get an error message: 'Method or Data Member not found' on the word
'Open' in the following line:

Set rsR = CurrentDb.Open("Generate_KML")

It suggests that something is mispelled or wrong reference, so I was worried
that the query it was calling was two seperate words, so I changed it to one
whole_word. But it still reports the same error message.

Can you help me with this?

"John Nurick" wrote:

There are many ways of skinning this cat. I'd probably do something like
this (air code):

Dim rsR As DAO.Recordset
Dim strLine As String
Dim lngFN As Long

'Create empty text file
lngFN = FreeFile()
Open "D:\Folder\Addresses.kml" For Output As #lngFN

'Output header
'NB: need to double quotes in literal strings
Print #lngFN, "?xml version="1.0" encoding=""UTF-8""?"
Print #lngFN, "kml xmlns=""http://earth.google.com/kml/2.0"""
'...

'Output address
Set rsR = CurrentDB.Open("My Query")
Print #lngFN, rsR.Fields("kml Address")
Close rsR

'Output footer
Print #lngFN blah blah

Close #lngFN

On Thu, 10 May 2007 10:35:01 -0700, efandango
wrote:

I have an address query which ouputs a single field to text strings for
Google Earth .kml file format parameters.

The problem is that the .kml file requires a header and footer text to be
inserted. Does anyone know how I can pre-insert the Header and Footer into a
standard text file, and then save it with a .kml extension, for example
Addresses.kml

This is the Header:

?xml version="1.0" encoding="UTF-8"?
kml xmlns="http://earth.google.com/kml/2.0"
Document
nameAddress List/name
Folder
nameLocations/name
open1/open

Output Field: [kml Address]

This is the Footer:

/Folder
/Document
/kml


--
John Nurick [Microsoft Access MVP]

Please respond in the newsgroup and not by email.
  #8  
Old May 11th, 2007, 11:39 AM posted to microsoft.public.access.externaldata,microsoft.public.access.reports,microsoft.public.access
efandango
external usenet poster
 
Posts: 489
Default Creating a custom text export file (inc. header & footer) from

John,

I now get this error in the line: Close rsR:
(highlighting the word 'Close')

Compile error:
Type mismatch:



"John Nurick" wrote:

My fault - though I warned you it was air code. Should be
CurrentDB.OpenRecordset("Generate_KML", dbOpenSnapshot)
not
CurrentDB.Open("Generate_KML")




On Thu, 10 May 2007 16:41:00 -0700, efandango
wrote:

John,

Just ignore the previous two posts from me.

This is how far i have got in adapting your code

Private Sub Test_Click()
Dim rsR As DAO.Recordset
Dim strLine As String
Dim lngFN As Long

'Create empty text file
lngFN = FreeFile()
Open "W:\Folder\Addresses.kml" For Output As #lngFN

'Output header
'NB: need to double quotes in literal strings
Print #lngFN, "?xml version="; 1#; " encoding=""UTF-8""?"
Print #lngFN, "kml xmlns=""http://earth.google.com/kml/2.0"""
Print #lngFN, "Document"
Print #lngFN, "nameAddress List/name"
Print #lngFN, "Folder"
Print #lngFN, "nameLocations/name"
Print #lngFN, "open1/open"
'...

'Output address
Set rsR = CurrentDb.Open("Generate_KML")
Print #lngFN, rsR.Fields("KML_Address")
Close rsR

'Output footer
Print #lngFN, "/Folder"
Print #lngFN, "/Document"
Print #lngFN, "/kml"
'...

Close #lngFN

End Sub


But i get an error message: 'Method or Data Member not found' on the word
'Open' in the following line:

Set rsR = CurrentDb.Open("Generate_KML")

It suggests that something is mispelled or wrong reference, so I was worried
that the query it was calling was two seperate words, so I changed it to one
whole_word. But it still reports the same error message.

Can you help me with this?

"John Nurick" wrote:

There are many ways of skinning this cat. I'd probably do something like
this (air code):

Dim rsR As DAO.Recordset
Dim strLine As String
Dim lngFN As Long

'Create empty text file
lngFN = FreeFile()
Open "D:\Folder\Addresses.kml" For Output As #lngFN

'Output header
'NB: need to double quotes in literal strings
Print #lngFN, "?xml version="1.0" encoding=""UTF-8""?"
Print #lngFN, "kml xmlns=""http://earth.google.com/kml/2.0"""
'...

'Output address
Set rsR = CurrentDB.Open("My Query")
Print #lngFN, rsR.Fields("kml Address")
Close rsR

'Output footer
Print #lngFN blah blah

Close #lngFN

On Thu, 10 May 2007 10:35:01 -0700, efandango
wrote:

I have an address query which ouputs a single field to text strings for
Google Earth .kml file format parameters.

The problem is that the .kml file requires a header and footer text to be
inserted. Does anyone know how I can pre-insert the Header and Footer into a
standard text file, and then save it with a ‘.kml’ extension, for example
‘Addresses.kml’

This is the Header:

?xml version="1.0" encoding="UTF-8"?
kml xmlns="http://earth.google.com/kml/2.0"
Document
nameAddress List/name
Folder
nameLocations/name
open1/open

Output Field: [kml Address]

This is the Footer:

/Folder
/Document
/kml


--
John Nurick [Microsoft Access MVP]

Please respond in the newsgroup and not by email.

  #9  
Old May 11th, 2007, 11:48 AM posted to microsoft.public.access.externaldata,microsoft.public.access.reports,microsoft.public.access
Douglas J. Steele
external usenet poster
 
Posts: 9,313
Default Creating a custom text export file (inc. header & footer) from

That's supposed to be rsR.Close (the Close #lngFN is correct though)

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"efandango" wrote in message
...
John,

I now get this error in the line: Close rsR:
(highlighting the word 'Close')

Compile error:
Type mismatch:



"John Nurick" wrote:

My fault - though I warned you it was air code. Should be
CurrentDB.OpenRecordset("Generate_KML", dbOpenSnapshot)
not
CurrentDB.Open("Generate_KML")




On Thu, 10 May 2007 16:41:00 -0700, efandango
wrote:

John,

Just ignore the previous two posts from me.

This is how far i have got in adapting your code

Private Sub Test_Click()
Dim rsR As DAO.Recordset
Dim strLine As String
Dim lngFN As Long

'Create empty text file
lngFN = FreeFile()
Open "W:\Folder\Addresses.kml" For Output As #lngFN

'Output header
'NB: need to double quotes in literal strings
Print #lngFN, "?xml version="; 1#; " encoding=""UTF-8""?"
Print #lngFN, "kml xmlns=""http://earth.google.com/kml/2.0"""
Print #lngFN, "Document"
Print #lngFN, "nameAddress List/name"
Print #lngFN, "Folder"
Print #lngFN, "nameLocations/name"
Print #lngFN, "open1/open"
'...

'Output address
Set rsR = CurrentDb.Open("Generate_KML")
Print #lngFN, rsR.Fields("KML_Address")
Close rsR

'Output footer
Print #lngFN, "/Folder"
Print #lngFN, "/Document"
Print #lngFN, "/kml"
'...

Close #lngFN

End Sub


But i get an error message: 'Method or Data Member not found' on the
word
'Open' in the following line:

Set rsR = CurrentDb.Open("Generate_KML")

It suggests that something is mispelled or wrong reference, so I was
worried
that the query it was calling was two seperate words, so I changed it to
one
whole_word. But it still reports the same error message.

Can you help me with this?

"John Nurick" wrote:

There are many ways of skinning this cat. I'd probably do something
like
this (air code):

Dim rsR As DAO.Recordset
Dim strLine As String
Dim lngFN As Long

'Create empty text file
lngFN = FreeFile()
Open "D:\Folder\Addresses.kml" For Output As #lngFN

'Output header
'NB: need to double quotes in literal strings
Print #lngFN, "?xml version="1.0" encoding=""UTF-8""?"
Print #lngFN, "kml xmlns=""http://earth.google.com/kml/2.0"""
'...

'Output address
Set rsR = CurrentDB.Open("My Query")
Print #lngFN, rsR.Fields("kml Address")
Close rsR

'Output footer
Print #lngFN blah blah

Close #lngFN

On Thu, 10 May 2007 10:35:01 -0700, efandango
wrote:

I have an address query which ouputs a single field to text strings
for
Google Earth .kml file format parameters.

The problem is that the .kml file requires a header and footer text
to be
inserted. Does anyone know how I can pre-insert the Header and Footer
into a
standard text file, and then save it with a '.kml' extension, for
example
'Addresses.kml'

This is the Header:

?xml version="1.0" encoding="UTF-8"?
kml xmlns="http://earth.google.com/kml/2.0"
Document
nameAddress List/name
Folder
nameLocations/name
open1/open

Output Field: [kml Address]

This is the Footer:

/Folder
/Document
/kml


--
John Nurick [Microsoft Access MVP]

Please respond in the newsgroup and not by email.



  #10  
Old May 11th, 2007, 12:52 PM posted to microsoft.public.access.externaldata,microsoft.public.access.reports,microsoft.public.access
efandango
external usenet poster
 
Posts: 489
Default Creating a custom text export file (inc. header & footer) from

Douglas/John,

that did the trick...

but I have a secondary problem (that i think is of my making...). The .kml
file only contains the first address in the query, and I think it's because
of my badly worded sentence 'I have an address query which ouputs a single
field to text strings for
Google Earth .kml file format parameters.' in my opening post. What I really
meant was it is a single field (among other fields in the query), but that it
contains multiple records/data.

eg:

Main St, London, W1
South St, London, W2
East St, London, SE1

Is it possible to get the routine to print All the data for that field to
the kml file?





"Douglas J. Steele" wrote:

That's supposed to be rsR.Close (the Close #lngFN is correct though)

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"efandango" wrote in message
...
John,

I now get this error in the line: Close rsR:
(highlighting the word 'Close')

Compile error:
Type mismatch:



"John Nurick" wrote:

My fault - though I warned you it was air code. Should be
CurrentDB.OpenRecordset("Generate_KML", dbOpenSnapshot)
not
CurrentDB.Open("Generate_KML")




On Thu, 10 May 2007 16:41:00 -0700, efandango
wrote:

John,

Just ignore the previous two posts from me.

This is how far i have got in adapting your code

Private Sub Test_Click()
Dim rsR As DAO.Recordset
Dim strLine As String
Dim lngFN As Long

'Create empty text file
lngFN = FreeFile()
Open "W:\Folder\Addresses.kml" For Output As #lngFN

'Output header
'NB: need to double quotes in literal strings
Print #lngFN, "?xml version="; 1#; " encoding=""UTF-8""?"
Print #lngFN, "kml xmlns=""http://earth.google.com/kml/2.0"""
Print #lngFN, "Document"
Print #lngFN, "nameAddress List/name"
Print #lngFN, "Folder"
Print #lngFN, "nameLocations/name"
Print #lngFN, "open1/open"
'...

'Output address
Set rsR = CurrentDb.Open("Generate_KML")
Print #lngFN, rsR.Fields("KML_Address")
Close rsR

'Output footer
Print #lngFN, "/Folder"
Print #lngFN, "/Document"
Print #lngFN, "/kml"
'...

Close #lngFN

End Sub


But i get an error message: 'Method or Data Member not found' on the
word
'Open' in the following line:

Set rsR = CurrentDb.Open("Generate_KML")

It suggests that something is mispelled or wrong reference, so I was
worried
that the query it was calling was two seperate words, so I changed it to
one
whole_word. But it still reports the same error message.

Can you help me with this?

"John Nurick" wrote:

There are many ways of skinning this cat. I'd probably do something
like
this (air code):

Dim rsR As DAO.Recordset
Dim strLine As String
Dim lngFN As Long

'Create empty text file
lngFN = FreeFile()
Open "D:\Folder\Addresses.kml" For Output As #lngFN

'Output header
'NB: need to double quotes in literal strings
Print #lngFN, "?xml version="1.0" encoding=""UTF-8""?"
Print #lngFN, "kml xmlns=""http://earth.google.com/kml/2.0"""
'...

'Output address
Set rsR = CurrentDB.Open("My Query")
Print #lngFN, rsR.Fields("kml Address")
Close rsR

'Output footer
Print #lngFN blah blah

Close #lngFN

On Thu, 10 May 2007 10:35:01 -0700, efandango
wrote:

I have an address query which ouputs a single field to text strings
for
Google Earth .kml file format parameters.

The problem is that the .kml file requires a header and footer text
to be
inserted. Does anyone know how I can pre-insert the Header and Footer
into a
standard text file, and then save it with a '.kml' extension, for
example
'Addresses.kml'

This is the Header:

?xml version="1.0" encoding="UTF-8"?
kml xmlns="http://earth.google.com/kml/2.0"
Document
nameAddress List/name
Folder
nameLocations/name
open1/open

Output Field: [kml Address]

This is the Footer:

/Folder
/Document
/kml

--
John Nurick [Microsoft Access MVP]

Please respond in the newsgroup and not by email.




 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 02:55 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright 2004-2020 OfficeFrustration.
The comments are property of their posters.