Topic Options
#19025 - 06/12/06 03:02 PM pass a PP5 variable to VB6
FormMaster Offline
OL Expert

Registered: 05/12/03
Posts: 193
Loc: Los Angeles
Hi there.

I have a small VB6 script that I would like to run from PP5. I want to pass the document name from PP5 to VB6. This is the VB6 line that needs the variable document name:

Set oDoc = oApp.Documents.Open("C:\VP Process\documents\%1.doc")

I put in the %1 as one of your examples shows, but it doesn't seem to work. Anys suggestions?

Thank you.

#19026 - 06/13/06 04:29 AM Re: pass a PP5 variable to VB6
stuartg Offline
OL Expert

Registered: 03/06/03
Posts: 713
Loc: Swindon, England
You can get the values of watch variables into a Vb script by using the ExpandString function
str = Watch.ExpandString("%1")

#19027 - 06/13/06 08:23 AM Re: pass a PP5 variable to VB6
Philippe F. Offline
OL Expert

Registered: 09/06/00
Posts: 1953
Loc: Objectif Lune, Montreal, Qc
Actually, for variables 1 through 9, you should use watch.getjobinfo(n), where n is a number from 1 to 9.

Stuart's technique is correct as well but it is more costly in terms of CPU cycles as the expandstring function needs to parse the string before returning the value.
Technical Product Manager
I don't want to achieve immortality through my work; I want to achieve immortality through not dying - Woody Allen