Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Word
application.errors
conversions
docmanagement
drawing.graphics
formatting.longdocs
international
internet.assistant
mail
mailmerge.fields
menustoolbars
newusers
numbering
oleinterop
pagelayout
printingfonts
setup.networking
spelling.grammar
tables
vba.addins
vba.beginners
vba.customization
vba.general
vba.userforms
web.authoring
word6-7macros
word97vba
  
 
date: Mon, 29 Sep 2008 07:46:01 -0700,    group: microsoft.public.word.vba.general        back       


Field Result   
I have a table with numeric fields in. I want to run a macro which deletes 
rows of the table if the result of a field is 0. I cannot seem to get the 
result into VBA. I have called the field POAC and bookmarked it ANSPC but 
when I put in if POAC = 0 then application.run macroname:="tidyup" it runs 
the macro even when the field is greater than 0

Any idea
date: Mon, 29 Sep 2008 07:46:01 -0700   author:   Daren White

Re: Field Result   
Hi Daren,

I don't know of a way to name a field.

Try something like that:

If Selection.Cells(1).Range.Fields(1).Result = "5" Then
   MsgBox "5"
End If
If ActiveDocument.Bookmarks("MyTest").Range.Fields(1).Result = "5"
Then
   MsgBox "5"
End If

--

Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Vista Small Business, Office XP
date: Mon, 29 Sep 2008 17:19:55 +0200   author:   Helmut Weber

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us