Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
i want to write a makro, which automatically
1. selects an item, for example "DR_a_x", out if a listbox (ObjectID "LB18"),
2. puts this in an existing diagramm (ObjectID"CH13"), which is linked to the listbox.
3. detaches the diagram.
How can i realise this with VBScript?
The listbox and the diagramm exist, therefor they dont have to be created. The detaching does work.
Best regards,
Mila
hi,
PFA. I hope this what you are looking for.
Thank you for the fast answer. Unfortunatly i cannot open the document because i have only the free version. Could u insert the makro text in this forum.
hi ,
This is the Macro Code
set v = ActiveDocument.Variables("vTest")
if v.GetContent.String = 1 then
ActiveDocument.GetSheetObject("CH01").Attach
else
ActiveDocument.GetSheetObject("CH01").Detach
end if
Hi,
i have some difficulties implementing your suggestions. What is the vTest? How should i name the Variable, which needs to be defined =if(getselectedcount(Fieldname whichneed to be selected)=0,1,0) ?
many thanks.
Mila
hi Mila,
vTest is the variable. You can name the variable as you required.
I had created vTest as the variable and stored that expression. and then I used the vTest in the macro.