Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
Can anyone share a sample application having a macro for default selection.
I want to apply this macro post relaod.
All my objects are in a particular state . Would that affect the macro?
Thanks
Khushboo
Check it out.
It works....
I corrected the syntax, now it is working fine.
Regards,
Patric
Hi,
what you mean with all my objects are in a particular state. Would that affect the macro?
Regards,
Patric
I am very much new to macro.
I mean say in a list box-product .i want to select default value as Product-A.
This list box is in a state -A?
can anyone help me with this macro.
Khushboo
So you are using alternate states in your app?
You can try to to do something like that:
ActiveDocument.Fields("YourField", "State1").SelectValues("yourValueHere")
Cheers,
Patric
so if i write this macro :
sub Default
ActiveDocument.Fields(".PGRP_LVL_1_DESC_TXT", "state-A").SelectValues("Product-A")
end sub
and on post reload ....apply this macro Default.
It should work ?
Thanks
Khushboo
after reload i am redirected to that macro
Does this macro work if you execute it from the modul-editor per click on Test-Button? What is the reason for these selection then normally a reload changed no former selection?
- Marcus
when i test this macro.it gives type mismatch error?
Check it out.
It works....
I corrected the syntax, now it is working fine.
Regards,
Patric
If I have a closer look on your statement I notice the attempt to select this field within a certain state but the APIGuide didn't know such a parameter and I think it made no sense, too then a field is global and only sheets respectively sheet-objects could belong to a state. Further the syntax isn't quite correct then it must be:
ActiveDocument.Fields("MARKETSIZINGV1.PGRP_LVL_1_DESC_TXT", "Explore_OAMS").SelectValues("Prevnar Franchise")
- Marcus