View Single Post
  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields
rick-global[_2_] rick-global[_2_] is offline
external usenet poster
 
Posts: 1
Default Compile error: Assignment to constant not permitted

Thanks for your help again Peter, that worked & no more compile error.

- Rick


"Peter Jamieson" wrote:

wdSuffix is the name of a predefined enum constant in the Word object
(it's a member of the wdMappedDatafields enumeration), and setting it in
Word 2007 does cause the error you describe. I would actually expect the
same error in Word 2003 but not in Word 2000 because the relevant
enumeration wasn't defined in that version.

I guess you could choose a different variable name, or possibly use

Dim wdSuffix

within your function/sub to ensure that the name references a local
variant rather than the predefined constant.

Peter Jamieson