Name does not exist in current context of code (error message)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • brat33
    New Member
    • Jan 2010
    • 36

    Name does not exist in current context of code (error message)

    I inheritede some code, and am making minor changes (email name changes) to the code, and want to recompile to another server.

    I am getting this error:
    "The name 'H39FE001E' does not exist in the current context"
    On this line of code:
    "emailSender.Fi elds(&H39FE001E );

    This is the code:
    Code:
     private string GetEmailAddress(AddressEntry emailSender)
            {
                string exchangeAddress = emailSender.Address.ToString().ToLower();
                emailSender.Fields(&H39FE001E);
    
                int aliasStart = exchangeAddress.LastIndexOf("=") + 1;
                int aliasLength = exchangeAddress.Length - aliasStart;
    
                if (aliasStart > 0) 
                {
                    string alias 
                        = exchangeAddress.Substring(aliasStart, aliasLength);
                    WriteToLog(exchangeAddress);
                    if (exchangeAddress.Contains("compWorld")) {
                        return String.Format("{0}@emailAddressHere.com", alias);
                    } else {
                        return String.Format("{0}@emailAddressHere.com", alias);
                    }
                } 
                else 
                {
                    WriteToLog(
                        "Sender email not determined -> " + 
                        exchangeAddress
                    );
    
                    // email address could not be determined, return a generic one
                    return "unknown@emailAddressHere";
                }
            }
    Thanks in advance for any assistance.
Working...