Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Start Word with command line parameter that contains data

Status
Not open for further replies.

BrianWen

Programmer
Jun 8, 2009
102
DK
I know it'sd a stretch, but is there a way to provide data to Word at the startup (loading a template actually). It would be the name of a person, that the template macro would use to pull data externally. the reason for all this is that the user clicks a link outside Word from the user profile, therefore they have in a way already chosen which person they's like the document to be about. Does that make sense?

So I'd like to be able to start the template/Word with something like this: h:\template.dot /data PersonsName and then be able to capture PersonsName name in VBA somehow...

I know it's a stretch :)
 
Please explain: "the reason for all this is that the user clicks a link outside Word from the user profile"

What does that actually mean?

"that the template macro would use to pull data externally."

If the template macro is doing...ANYTHING...then Word is already started. A Word macro can not do anything unless Word is there to make it do something.

Gerry
 


Hi,

How about MailMerge with one name in the data source.

What application are you running before Word is opened?

Is this a VBA Procedure in your application?

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
As usual Skip articulates better than I do.

Gerry
 
Something like Environ("USERNAME") ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
OK, let me explain it a little better.

It's a Notes database where the user would be looking at a user's profile (a document in the database). In other words, he has already located the specific user he likes to 'use'. That means I could make a link to the Word template (that makes a document with user information pulled from the Notes database). As it is now, they have to state the person in the template in a form popping up. I feel that it's a shame, that the user has to specify the user in the Word form when, in a way, he has already told Notes what user to make the document from.

Therefore, if I could provide Word with the username via the link, it would be perfect...
 
Skip: Based on my more precise explanation, would you concider MailMerge an option? - I haven't used that feature in Word/Office ever before, but if it's an option for this particular problem, then I'll dive into it...
 


I'd probably go that direction.

In your db, you need a way to identify THE row that you want to process "automatically." Maybe the Latest EntryDate. Don't know what the processing requirement is? Are you doing these serially... 1. enter data in Notes, 2. Open Word template to process the data just entered? Or will this be a BATCH kind of thing where one or more are entered in the db and then that "batch" is processed?

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top