Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello 🙂
Now I have macro:
sub SelectA
ActiveDocument.ClearAll
call ActiveDocument.Fields("Field1").Select("A")
end sub
it works.
I need
SelectAandB
sub SelectA
ActiveDocument.ClearAll
call ActiveDocument.Fields("Field1").Select("A,B")
end sub
It does not work.
Please help me.
P.S. I found the same posts in archive but it not helps me.
I find how:
sub SelectAandB
set f = ActiveDocument.Fields("Field1")
set fv = f.GetNoValues
fv.Add
fv.Add
fv(0).Text = "A"
fv(0).IsNumeric = false
fv(1).Text = "B"
fv(1).IsNumeric = false
f.SelectValues fv
end sub
I find how:
sub SelectAandB
set f = ActiveDocument.Fields("Field1")
set fv = f.GetNoValues
fv.Add
fv.Add
fv(0).Text = "A"
fv(0).IsNumeric = false
fv(1).Text = "B"
fv(1).IsNumeric = false
f.SelectValues fv
end sub
Hi Artur,
here are some more examples:
sub SelectDates
startdate = ActiveDocument.Variables("vStartDate").GetContent.String
enddate = ActiveDocument.Variables("vEndDate").GetContent.String
selectstring = ">=" & startdate & " <=" & enddate
ActiveDocument.Fields("SelektDatum").Select selectstring
'ActiveDocument.Fields("DateSelection").Select ">=34374 <=39499"
msgbox selectstring
end sub
Sub SelectYears
set y=ActiveDocument.GetField("Year")
y.Select ">=" & 2007 & "<=" & 2008
End Sub
'set y=ActiveDocument.GetField("Year")
'y.Select 2009
'or:
'y.Select ActiveDocument.Evaluate("year(today())")
'or:
'y.Select ">=" & 2007 & "<=" & 2008
Rainer
Hey guys,
That's very useful for me! That's I was looking for!
Thanks!