View unanswered posts | View active topics It is currently Mon Sep 06, 2010 12:26 pm



Post new topic Reply to topic  [ 4 posts ] 
 Function return values and parameters "RunTemplateWithData" 
Author Message
Reply with quote
Post Function return values and parameters "RunTemplateWithData"
It would be very handy to be able to pass in an empty variant array and have the xPressDox engine fill it with the names and values of variables and data elements found to be in used in the template.

e.g.

MyArray(1, 1) = "D" or "V" (D=Data Element)
MyArray(1, 2) = Name of Variable or Data Element
MyArray(i, 3) = value of variable or data element

Why? Because I may wish to run a macro (after assembly) from my template selection engine that requires that information for decision-making purposes. The odd time (rare but where used it is a requirement it would get me out of a big pickle).


Mon Feb 01, 2010 1:34 pm
Report this post

Joined: Tue Sep 29, 2009 4:27 am
Posts: 64
Reply with quote
Post Re: Function return values and parameters "RunTemplateWithData"
Hi Josie

But wouldn't you already know the values of the data, seeing that's what you passed to the RunTemplateWithData?

I'll read your post again in the morning (my morning - tomorrow :) ) and see if it works better for me.

Peter

_________________
Peter Tuffin


Mon Feb 01, 2010 1:52 pm
Report this post
Profile Send private message
Reply with quote
Post Re: Function return values and parameters "RunTemplateWithData"
Thanks Peter,

Maybe I ask the question too soon in my learning. I'm assuming that launching the merge process from the API function doesn't preclude my using xPressDox statements to set variables in the document. If same is possible, then the requesting VBA macro may require access to those variables to complete its process.

A similar requirement comes to mind. I see you have statements to set the document name and folder. I haven't given them a test drive yet but will soon. Although I am saving the assembled documents to the document manager, those statements could come in handy. I am hoping that the values set there can be accessible to the VBA macro so that the VBA macro can then pass them to its procedure to populate the document management profile. With this question, I'm actually putting the cart before the horse so to speak. The answer to related questions which I have yet to post here will shed some light about whether this is necessary. That is, I have some questions about choosing among repeating data when the merge is launched from the API function.

Also, I may pass in a "generic" set of data elements, not all of which are used in each and every xPressDocs template. E.g. I'll for all correspondence templates, I will pass in the full set of fields for the chosen author and the xPressDox template will use what it needs. That is working fine now. For example, the author's preference for letter closing (e.g. Yours truly) will be passed for any template that requires author information, but it will only be used for the letter templates.

So I'm thinking if you just pass me back the names and values of the data elements and variables that were actually used in or created by the merge process for the template being assembled, then the possibilities are endless as to seamless integration between the Word VBA template launcher and the xPressDox merge process.


Thanks!


Mon Feb 01, 2010 2:21 pm
Report this post

Joined: Tue Sep 29, 2009 4:27 am
Posts: 64
Reply with quote
Post Re: Function return values and parameters "RunTemplateWithData"
Hi Josie

So here's what I am going to do:
In viewtopic.php?f=14&t=17 I have spoken about the new proposed RunTemplate command.

In addition, I will add a function GetSchema to which you pass a template name, and the function will return the XML Schema for that template. Since an XML Schema is very formal and all you really want it for is a to get a list of data elements required by the template, I will give you a tool for getting out a list of data element names.

Then - RunTemplate will return an object one of whose properties will be the set of data returned by the Data Capture Dialog, including any new data elements which the template may have created with the <<CreateDataElement>> command (that command is a way of converting Variables (whose lifetime is very short - they disappear once a template is completely merged) into Data Elements).

On top of that, I will give you (i.e. the API developer) a mechanism of converting XML data into a Name/Value list.

I hope all of that would help you get the results you are looking for in this post?

_________________
Peter Tuffin


Last bumped by Anonymous on Thu May 06, 2010 9:34 am.


Thu May 06, 2010 9:34 am
Report this post
Profile Send private message
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 


Who is online

Users browsing this forum: No registered users and 1 guest


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You can post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by Vjacheslav Trushkin for Free Forums/DivisionCore.