View Single Post
  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Mark McGinty Mark McGinty is offline
external usenet poster
 
Posts: 7
Default CSV merge data via HTTP: redundant downloads?

Peter,

I was hoping you would reply! :-) You may recal we discussed related
issues 6-8 months ago? Your input was quite valuable to say the least.


"Peter Jamieson" wrote in message
...
I can't answer your question, but could not get to the point where Word
would open my csv from an http address so could not look at the traffic.

Maybe you could let me know precisely what changes you ended up making in
your xml.


In a nutshell, I set w:mailMerge/w:query-w:val to "SELECT * FROM " & Url,
and w:mailMerge/w:dataSource-w:val to Url, then build the field structure.
To tell you *precisely*, VBS code is below -- note that I edited it to
remove the convoluted bits that aren't especially relevant. Stuff in {} are
tokens to represent the end result of some processing. (Hopefully I didn't
make any syntax errors.)
__________________________________________________

[Apparently VBScript code isn't allowed in posts anymore? This is the third
time I've posted this, except this time without the code. I can email it to
you privately, or I can stick it on my web host somewhere, whatever you
prefer.]
________________________________________________

The blank doc was created by merging with a local CSV -- and possibly
hacked/mangled in some way by hand after, I can't recall. It does open in
Word without modifications, given that same local file exists.

*Trick when analyzing WordXML: comment the second node, so it loads in IE
nicely formatted.

Something I just noticed, when I save the doc to file, Word replaces
w:mailMerge/w:query-w:val with "SELECT * FROM {8-digit hex}.asp" (Not
necessarily relevant, but certainly interesting.) So apparently it creates
something on the client system, however, the data is definitely dynamic
every time the document is opened. (The same SQL is used, but the same
criteria could return a different set of records tomorrow, than it did
yeaterday.)

An aside, last time we corrsponded I had given up on using HTML as the
format, couldn't get it to work, but in re-testing/re-validating my
observations/assumptions, I realized I must've given up while trying to get
the UI to use an HTTP-based source. I should probably experiment more with
it. I saw that HTML the value of w:mailMerge/w:query-w:val is "SELECT *
FROM table". What to infer from that, I'm uncertain.

Another aside, a couple of times I've accidentally stumbled into a condition
where Word prompts me to save the current merge data, and the dialog allows
you to pick the format. It's some combination of editing the data in Word
and then changing something about the source -- I don't know exactly how to
repeat it. In any case, one time it came up I saved the data as XML -- very
ugly stuff, I can't decide if it is more bloated than convoluted or vice
versa, but I can say I have no interest in generating it. :-)

Thanks for the reply!


-Mark