Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Script macro

I have the following script macro vb

  1. Doc.FIelds("Date").SELECT A.GetContent.STRING          

SET Field = Doc.Fields(FieldName).GetPossibleValues

FOR i=0 to Field.Count-1

  1. Doc.Fields("CodeGroupe").Clear
  2. Doc.FIelds(FieldName).SELECT Field.Item(i).Text

SET FlagStockSiteManquant = ActiveDocument.Variables("vFlagStockSiteManquant")

FlagStockSiteManquant = FlagStockSiteManquant.GetContent.STRING

SET Flag = ActiveDocument.Variables("vFlag")

Flag = Flag.GetContent.STRING

SET Nom = ActiveDocument.Variables("vName")

Nom = Nom.GetContent.STRING

SET Mail = ActiveDocument.Variables("vMail")

Mail = Mail.GetContent.STRING

SET Reference = ActiveDocument.Variables("vReference")

Reference = Reference.GetContent.STRING

  1. Doc.FIelds("Code Reference").SELECT Reference

NEXTNEXT

How could I verify if Field.Item(i).Text still possible to select after select Reference ? I some case Field.Item(i).Text  could not be selected after I select Reference and return wqrong values when export .

2 Replies
swuehl
MVP
MVP

Not really sure, but the reference doesn't seem to change during your for loop, is this true?

Maybe get all variables in the beginning of your code, and set the reference to code reference before retrieving the possible values for FieldName.

Anonymous
Not applicable
Author

No , reference  change for every Field.Item(i).Text