Daniel_Corsa
Premium Member
Registered: 21st Apr 04
Location: Wigton, Cumbria
User status: Offline
|
On with rolling out autosignatures at work using AD.
We have it set so picks up all basic info
Name | Job | Division | Address |
Tel: +44**** | Fax: +44****
Only certain members of staff wish to display their mobile numbers, the above is obviosuly fairly basic but how would I go about if AD has the mobile field filled in, it adds "Mob:" then number
So for users without a mobile they get above and for users with a mobile they get the following;
Name | Job | Division | Address |
Tel: +44**** | Mob: +44**** | Fax: +44****
Whats best way to do this, I have template set at the moment so have Tel: _______ | Fax: _____ if I were to use plainTextFile.WriteLine(“| Mob: ” & objLDAPUser.mobile)
How would I get that to only show if Mobile field has a value? and skip if no value.
Sorry, this is probably really simple or me being thick!
April '06' Corsasport Feature Car | Aug '08' Total Vauxhall Feature Car | Spring '09' Fast Car Feature Car
|
Dom
Member
Registered: 13th Sep 03
User status: Offline
|
Use an IF statement with a condition to check if the objLDAPUser.mobile variable is empty or not.
ie -
code: If objLDAPUser.mobile IsNot Nothing Then TextFile.WriteLine(“| Mob: ” & objLDAPUser.mobile)
or
If Not (isempty(objLDAPUser.mobile)) Then TextFile.WriteLine(“| Mob: ” & objLDAPUser.mobile)
[Edited on 26-10-2011 by Dom]
|
Daniel_Corsa
Premium Member
Registered: 21st Apr 04
Location: Wigton, Cumbria
User status: Offline
|
Shall try that out in morning Dom, cheers!
April '06' Corsasport Feature Car | Aug '08' Total Vauxhall Feature Car | Spring '09' Fast Car Feature Car
|
Ian
Site Administrator
Registered: 28th Aug 99
Location: Liverpool
User status: Online
|
But don't use wonky quotes.
|
Daniel_Corsa
Premium Member
Registered: 21st Apr 04
Location: Wigton, Cumbria
User status: Offline
|
Working now thanks Dom!
[Edited on 27-10-2011 by Daniel_Corsa]
April '06' Corsasport Feature Car | Aug '08' Total Vauxhall Feature Car | Spring '09' Fast Car Feature Car
|
Dom
Member
Registered: 13th Sep 03
User status: Offline
|
Could try -
code: If Not objLDAPUser.mobile = empty Then TextFile.WriteLine("| Mob: " & objLDAPUser.mobile)
Might be worth checking that objLDAPUser.mobile is returning as empty on a blank field. As Ian, make sure you're using the correct double quotes (as above - "") and not the 'wonky' quotes you've posted here (ie: “”).
Edit - Glad it's sorted 
[Edited on 27-10-2011 by Dom]
|