Page 1 of 1 1
Topic Options
#201001 - 2010-12-03 02:19 PM Outlook Signature... conversion...
pink_stig Offline
Fresh Scripter

Registered: 2010-09-01
Posts: 10
Loc: Lincoln
Hi Guys,

I was wondering if you could help me.... My boss has very kindly sent me a file he created for out new email signatures in Outlook 2003. He wants me to roll this out using kix and I believe we need to convert this or call it as a seperate file.

Can anyone point me in the right direction, I'm not very good a scripting though :o/

Here is the text below he wants me to roll out using kix...

Set objLDAPUser = GetObject("LDAP://" & GetUserDN(userName,domainName))

'Prepare to create some files
Dim objFSO, objWsh, appDataPath, pathToCopyTo, plainTextFile, plainTextFilePath, richTextFile, richTextFilePath, htmlFile, htmlFilePath
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objWsh = CreateObject("WScript.Shell")
appDataPath = objWsh.ExpandEnvironmentStrings("%APPDATA%")
pathToCopyTo = appDataPath & "\Microsoft\Signatures\"


'And finally, the HTML signature
htmlFilePath = pathToCopyTo & "Default.htm"
Set htmlFile = objFSO.CreateTextFile(htmlFilePath, TRUE)
htmlfile.WriteLine("<!DOCTYPE html PUBLIC ""-//W3C//DTD XHTML 1.0 Transitional//EN"" ""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"">")
htmlfile.WriteLine("<html xmlns=""http://www.w3.org/1999/xhtml"" >")
htmlfile.WriteLine("<body>")
htmlfile.WriteLine("<div style=""font-size:12pt;font-weight:'700';font-family:'Arial'; color:'gray';"">")
htmlfile.WriteLine("<div>" & objLDAPUser.DisplayName & "</div>")
htmlfile.WriteLine("<div style=""font-size:12pt;font-weight:'normal';font-family:'Arial'; color:'gray';"">")
htmlfile.WriteLine("<div>" & objLDAPUser.title & "</div>")
htmlfile.WriteLine("<span style=""font-size:12pt; font-family:'Arial','helvetica';color:'white';"">BLANKLINE</span><P>")
htmlfile.WriteLine("<div style=""font-size:14pt;font-weight:'normal'; font-family:'Arial'; color:'gray';"">")
htmlfile.WriteLine("<div>" & objLDAPUser.company & "</div>")
htmlfile.WriteLine("<span style=""font-size:7.5pt; font-family:'Arial','helvetica';color:'gray';"">Design Architecture Masterplanning Interiors Graphics</span><P>")
htmlfile.WriteLine("<span style=""font-size:8pt; font-family:'Arial','helvetica';color:'gray';"">Winner – Queen’s Award for Enterprise: International Trade 2008 </span>")
htmlfile.WriteLine("<div style=""font-size:8pt; font-family:'Arial'; color:'gray';"">")
htmlfile.WriteLine("<div>T: " & objLDAPUser.telephoneNumber & "</div>")
htmlfile.WriteLine("<div>F: " & objLDAPUser.facsimileTelephoneNumber & "</div>")
htmlfile.WriteLine("<span style=""font-size:12pt; font-family:'Arial','helvetica';color:'white';"">BLANKLINE</span><P>")
htmlfile.WriteLine("<div style=""font-size:9pt; font-family:'Arial'; color:'gray';"">")
htmlfile.WriteLine("<div> <a href=""http://" & objLDAPUser.wWWHomePage & """>" & objLDAPUser.wWWHomePage & "</a></div>")
htmlfile.WriteLine("<span style=""font-size:12pt; font-family:'Arial','helvetica';color:'white';"">BLANKLINE</span><P>")
htmlfile.WriteLine("</div>")
htmlfile.WriteLine("<span style=""font-size:18pt; color:'#33CCCC'; font-family:'Webdings','helvetica';"">P </span><span style=""font-size:7.5pt; font-family:'Arial','helvetica';color:'#33CCCC';"">Please consider the environment before printing this e-mail. </span>")
htmlfile.WriteLine("</body>")
htmlfile.Write("</html>")

To see if it would work, it was a high hope though, I put this into Kix and I get an error message,

ERROR : error in parameterdefinition of [getuserdn]!
Script: T:\bny_email.kix

This is due to the first line of text I know but if anyone can point me in the right direction that would be great. Im not sure how I go about creating a new one from scratch even though I have read the email signature topics in here...

Thanks a lot...

Lara 'A not very good at scripting' IT person...

Top
#201002 - 2010-12-03 02:30 PM Re: Outlook Signature... conversion... [Re: pink_stig]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
The code that you posted is not kixtart. Looks like vbs.

Have a look at the link below. This is how we setup the signatures for all our users and it works great.

http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Number=200649
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#201003 - 2010-12-03 06:05 PM Re: Outlook Signature... conversion... [Re: Mart]
pink_stig Offline
Fresh Scripter

Registered: 2010-09-01
Posts: 10
Loc: Lincoln
Thanks for all the help... Here is what I have managed to do so far... It may be a little messy but it has got me lots further than I had ever hoped!!!!

Could you help me hyperlink the website please.... I did try a few thing but it didnt work out...

Thanks,


$objSysInfo = CreateObject("ADSystemInfo")
$strUser = $objSysInfo.UserName
$objUser = GetObject("LDAP://" + $strUser)

$strName = $objUser.FullName
$strSN = $objUser.sn
$strmobile = $objUser.mobile
$strTitle = $objUser.Title
$strDepartment = $objUser.Department
$strCompany = $objUser.Company
$strPhone = $objUser.telephoneNumber
$strGivenName = $objUser.givenname
$strMail = $objUser.mail
$strFax = $objuser.facsimileTelephoneNumber
$strWeb = $objUser.wWWHomePage

$objWord = CreateObject("Word.Application")

$objDoc = $objWord.Documents.Add()
$objSelection = $objWord.Selection

$objEmailOptions = $objWord.EmailOptions
$objSignatureObject = $objEmailOptions.EmailSignature
$objSignatureEntries = $objSignatureObject.EmailSignatureEntries

$objSelection.Font.Name = "Arial"
$objSelection.Font.Size = "12"
$objSelection.Font.Color = "8421504"
$objSelection.Font.Bold = "1"
$objSelection.TypeText($strGivenName + " " + $strSN)


$objSelection.Font.Name = "Arial"
$objSelection.Font.Size = "12"
$objSelection.Font.Color = "8421504"
$objSelection.Font.Bold = "0"
$objSelection.TypeText(Chr(11))
$objSelection.TypeText($strTitle)


$objSelection.TypeText(Chr(11))
$objSelection.TypeText(Chr(11))


$objSelection.Font.Name = "Arial"
$objSelection.Font.Size = "14"
$objSelection.Font.Color = "8421504"
$objSelection.Font.Bold = "0"
$objSelection.TypeText(Company Name)
$objSelection.TypeText(Chr(11))


$objSelection.Font.Name = "Arial"
$objSelection.Font.Size = "7.5"
$objSelection.Font.Color = "8421504"
$objSelection.Font.Bold = "0"
$objSelection.TypeText("Design Architecture Masterplanning Interiors Graphics")
$objSelection.TypeText(Chr(11))

$objSelection.TypeText(Chr(11))

$objSelection.Font.Name = "Arial"
$objSelection.Font.Size = "8"
$objSelection.Font.Color = "8421504"
$objSelection.Font.Bold = "0"
$objSelection.TypeText("Winner - Queen's Award for Enterprise 2008")
$objSelection.TypeText(Chr(11))
$objSelection.TypeText(Chr(11))


$objSelection.TypeText("T: " + $strPhone)
$objSelection.TypeText(Chr(11))


$objSelection.TypeText("F: " + $strfax)
$objSelection.TypeText(Chr(11))
$objSelection.TypeText(Chr(11))


$objSelection.TypeText($strWeb)
$objSelection.TypeText(Chr(11))
$objSelection.TypeText(Chr(11))


$objSelection.Font.Name = "Arial"
$objSelection.Font.Size = "8"
$objSelection.Font.Color = "13421619"
$objSelection.Font.Bold = "0"
$objSelection.TypeText("Please consider the environment - only print this e-mail if absolutely necessary")


$objSelection = $objDoc.Range()


$objSignature=$objSignatureEntries.Add("Signature", $objSelection)
$objSignatureObject.NewMessageSignature = "Signature"
$objSignatureObject.ReplyMessageSignature = "Signature"

$objDoc.Saved = 1
$objWord.Quit

Top
#201005 - 2010-12-03 11:57 PM Re: Outlook Signature... conversion... [Re: pink_stig]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4401
Loc: New Jersey
Or you could just look in the script vault for a ready-made app.
\:D
Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#201272 - 2010-12-23 12:40 PM Re: Outlook Signature... conversion... [Re: Glenn Barnas]
pink_stig Offline
Fresh Scripter

Registered: 2010-09-01
Posts: 10
Loc: Lincoln
Hey guys, Cheers for the help so far...

The script has been rolled out for testing and works fine on XP machines. Is there something else I need to do to get it to work on Windows 7???

Top
#201274 - 2010-12-23 01:06 PM Re: Outlook Signature... conversion... [Re: pink_stig]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4401
Loc: New Jersey
The problem with the script you posted is that it has a dependency on MS Word, and possibly even a specific version of word. As you progress to new versions of software in the environment, you'll need to constantly tune, adjust, and possiby duplicate your efforts to platform-specific configurations. What happens if there's a budget cut and 50% of the machines get Open Office?

The script in the vault has no application dependencies and has been used with Outlook 2000, 2003, and 2007 on Windows XP, Vista, and 7 - both x86 and x64. I haven't yet tested it on Outlook 2010.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#201276 - 2010-12-23 05:14 PM Re: Outlook Signature... conversion... [Re: Glenn Barnas]
Arend_ Moderator Offline
MM club member
*****

Registered: 2005-01-17
Posts: 1896
Loc: Hilversum, The Netherlands
And where is this "Vault" of yours?
Top
#201277 - 2010-12-23 05:17 PM Re: Outlook Signature... conversion... [Re: Arend_]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
Glenn's vault ;\)
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#201284 - 2010-12-23 07:10 PM Re: Outlook Signature... conversion... [Re: Arend_]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4401
Loc: New Jersey
It's not mine - I just manage it.. It's the KORG Script Vault - where ya been? ;\)

The KORG Script Vault - a place for (almost) ready-made scripts.

I sent out invitations over 2 years ago to request scripts from you guys. Only got one response, and from an occasional poster at that.

The invitation stands - just need the script and a description of how it works / can be customized. I'll format it and post it.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#201286 - 2010-12-23 08:08 PM Re: Outlook Signature... conversion... [Re: Glenn Barnas]
Arend_ Moderator Offline
MM club member
*****

Registered: 2005-01-17
Posts: 1896
Loc: Hilversum, The Netherlands
LOL, I always write my own stuff, never even used one of the UDF's \:\)
I'll see what I can submit, I just wrote a LastLogon property script for all PC's in the Domain (querying and evaluating times on ALL DC's).

Top
#201287 - 2010-12-23 11:10 PM Re: Outlook Signature... conversion... [Re: Arend_]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4401
Loc: New Jersey
About time you're getting with the program (pun intended!) \:D
_________________________
Actually I am a Rocket Scientist! \:D

Top
#201362 - 2011-01-12 03:57 PM Re: Outlook Signature... conversion... [Re: Glenn Barnas]
pink_stig Offline
Fresh Scripter

Registered: 2010-09-01
Posts: 10
Loc: Lincoln
Hey Guys,

Just a bit of an update on the scripting stuff... The leash has been lifted and I'm have been testing my very limited scripting skills... Not sure this post even has the weight to be in the Advanced Scripting section to be honest...

Anyway.. just thought it maybe helpful to someone else. So here is how far I have got.

Here is the full script:

 Code:
IF INGROUP("Domain Users")

$objSysInfo     = CreateObject("ADSystemInfo")
$strUser 	= $objSysInfo.UserName
$objUser	= GetObject("LDAP://" + $strUser)
 
$strName 	= $objUser.FullName
$strSN 		= $objUser.sn
$strmobile 	= $objUser.mobile
$strTitle 	= $objUser.Title
$strDepartment 	= $objUser.Department
$strCompany 	= $objUser.Company
$strPhone 	= $objUser.telephoneNumber
$strGivenName 	= $objUser.givenname
$strMail 	= $objUser.mail
$strFax		= $objuser.facsimileTelephoneNumber
$strWeb		= $objUser.wWWHomePage
 
$objWord 	= CreateObject("Word.Application")
 
$objDoc 	= $objWord.Documents.Add()
$objSelection = $objWord.Selection
 
$objEmailOptions = $objWord.EmailOptions
$objSignatureObject = $objEmailOptions.EmailSignature
$objSignatureEntries = $objSignatureObject.EmailSignatureEntries

$objSelection.Font.Name = "Arial" 
$objSelection.Font.Size = "12"
$objSelection.Font.Color = "8421504"
$objSelection.Font.Bold = "1"
$objSelection.TypeText($strGivenName + " " + $strSN)

$objSelection.Font.Name = "Arial" 
$objSelection.Font.Size = "12"
$objSelection.Font.Color = "8421504"
$objSelection.Font.Bold = "0"
$objSelection.TypeText(Chr(11))
$objSelection.TypeText($strTitle)

$objSelection.TypeText(Chr(11))
$objSelection.TypeText(Chr(11))

$objSelection.Font.Name = "Arial" 
$objSelection.Font.Size = "14"
$objSelection.Font.Color = "8421504"
$objSelection.Font.Bold = "0"
$objSelection.TypeText(Company)
$objSelection.TypeText(Chr(11))


$objSelection.Font.Name = "Arial"
$objSelection.Font.Size = "7.5"
$objSelection.Font.Color = "8421504"
$objSelection.Font.Bold = "0"
$objSelection.TypeText("Design  Architecture  Masterplanning  Interiors  Graphics")
$objSelection.TypeText(Chr(11))

$objSelection.TypeText(Chr(11))

$objSelection.Font.Name = "Arial"
$objSelection.Font.Size = "8"
$objSelection.Font.Color = "8421504"
$objSelection.Font.Bold = "0"
$objSelection.TypeText("Winner - Queen's Award for Enterprise: International Trade 2008")
$objSelection.TypeText(Chr(11))
$objSelection.TypeText(Chr(11))


$objSelection.TypeText("T: " + $strPhone)
$objSelection.TypeText(Chr(11))


$objSelection.TypeText("F: " + $strfax)
$objSelection.TypeText(Chr(11))
$objSelection.TypeText(Chr(11))


$objSelection.TypeText($strWeb)
$objSelection.TypeText(Chr(11))
$objSelection.TypeText(Chr(11))


;adds the tree webding to the signature
$objSelection.Font.Name = "Webdings"
$objSelection.Font.Size = "18"
$objSelection.Font.Color = "13421619"
$objSelection.Font.Bold = "1"
$objSelection.Font.Italic = "1"
$objSelection.TypeText("P")


$objSelection.Font.Name = "Arial"
$objSelection.Font.Size = "8"
$objSelection.Font.Color = "13421619"
$objSelection.Font.Bold = "0"
$objSelection.Font.Italic = "0"
$objSelection.TypeText("   Please consider the environment - only print this e-mail if absolutely necessary")

$objSelection = $objDoc.Range()
 
;this specifies what the signature is the be called and whether you want it to apply to forward and reply etc
$objSignature=$objSignatureEntries.Add("default", $objSelection)
$objSignatureObject.NewMessageSignature = "default"
$objSignatureObject.ReplyMessageSignature = "default"
 
$objDoc.Saved = 1
$objWord.Quit

ENDIF


(then there is a code to run our network drives, which always worked ok...)

 Code:
IF INGROUP("EMAIL IMAGE")

CALL "email_image.kix"

CLS


The top part of the code creates the default company email signature for all users, and it works on XP Pro, Windows 7 and Office 2003 and Office 2010.

the 2nd part calls another kix script that incororates an image based on groups...

It is working fine for what we need to do and will mean we no longer have to visit each machine anymore... so all is well with the world. So all my hard work and the boss will probably take all the credit as always... lol.

Couldnt have done it without your help guys, thanks...


Edited by Mart (2011-01-12 04:17 PM)
Edit Reason: Please use code tags when posting code.

Top
#201363 - 2011-01-12 04:26 PM Re: Outlook Signature... conversion... [Re: pink_stig]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
Two small comments.
You set the font name, size and color every time something is written to the signature. This is not needed. You only need to set the font name, size or color if you want the following text in a different font, size or color then what you set it to earlier. There is one line that writes the word company, I guess you want to write the company name there.

I modified your code to reflect my comments.

 Code:
If InGroup("Domain Users")
	
	$objSysInfo = CreateObject("ADSystemInfo")
	$strUser = $objSysInfo.UserName
	$objUser = GetObject("LDAP://" + $strUser)
	 
	$strName = $objUser.FullName
	$strSN = $objUser.sn
	$strmobile = $objUser.mobile
	$strTitle = $objUser.Title
	$strDepartment = $objUser.Department
	$strCompany = $objUser.Company
	$strPhone = $objUser.telephoneNumber
	$strGivenName = $objUser.givenname
	$strMail = $objUser.mail
	$strFax = $objuser.facsimileTelephoneNumber
	$strWeb = $objUser.wWWHomePage
	 
	$objWord = CreateObject("Word.Application")
	 
	$objDoc = $objWord.Documents.Add()
	$objSelection = $objWord.Selection
	 
	$objEmailOptions = $objWord.EmailOptions
	$objSignatureObject = $objEmailOptions.EmailSignature
	$objSignatureEntries = $objSignatureObject.EmailSignatureEntries
	
	$objSelection.Font.Name = "Arial" 
	$objSelection.Font.Size = "12"
	$objSelection.Font.Color = "8421504"
	$objSelection.Font.Bold = "1"
	$objSelection.TypeText($strGivenName + " " + $strSN)
	
	$objSelection.Font.Bold = "0"
	$objSelection.TypeText(Chr(11))
	$objSelection.TypeText($strTitle)
	
	$objSelection.TypeText(Chr(11))
	$objSelection.TypeText(Chr(11))
	
	$objSelection.Font.Size = "14"
	$objSelection.TypeText($strCompany)
	$objSelection.TypeText(Chr(11))
	
	$objSelection.Font.Size = "7.5"
	$objSelection.TypeText("Design  Architecture  Masterplanning  Interiors  Graphics")
	$objSelection.TypeText(Chr(11))
	
	$objSelection.TypeText(Chr(11))
	
	$objSelection.Font.Size = "8"
	$objSelection.TypeText("Winner - Queen's Award for Enterprise: International Trade 2008")
	$objSelection.TypeText(Chr(11))
	$objSelection.TypeText(Chr(11))
	
	$objSelection.TypeText("T: " + $strPhone)
	$objSelection.TypeText(Chr(11))
	
	$objSelection.TypeText("F: " + $strfax)
	$objSelection.TypeText(Chr(11))
	$objSelection.TypeText(Chr(11))
	
	$objSelection.TypeText($strWeb)
	$objSelection.TypeText(Chr(11))
	$objSelection.TypeText(Chr(11))
	
	;adds the tree webding to the signature
	$objSelection.Font.Name = "Webdings"
	$objSelection.Font.Size = "18"
	$objSelection.Font.Color = "13421619"
	$objSelection.Font.Bold = "1"
	$objSelection.Font.Italic = "1"
	$objSelection.TypeText("P")
	
	
	$objSelection.Font.Name = "Arial"
	$objSelection.Font.Size = "8"
	$objSelection.Font.Color = "13421619"
	$objSelection.Font.Bold = "0"
	$objSelection.Font.Italic = "0"
	$objSelection.TypeText("   Please consider the environment - only print this e-mail if absolutely necessary")
	
	$objSelection = $objDoc.Range()
	 
	;this specifies what the signature is the be called and whether you want it to apply to forward and reply etc
	$objSignature = $objSignatureEntries.Add("default", $objSelection)
	$objSignatureObject.NewMessageSignature = "default"
	$objSignatureObject.ReplyMessageSignature = "default"
	 
	$objDoc.Saved = 1
	$objWord.Quit
EndIf
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#201364 - 2011-01-12 04:55 PM Re: Outlook Signature... conversion... [Re: Mart]
pink_stig Offline
Fresh Scripter

Registered: 2010-09-01
Posts: 10
Loc: Lincoln
Ok, thanks for that... I'll give it a go :o)
Top
#201633 - 2011-02-22 10:58 AM Re: Outlook Signature... conversion... [Re: pink_stig]
pink_stig Offline
Fresh Scripter

Registered: 2010-09-01
Posts: 10
Loc: Lincoln
Hey guys,

I am successfully running this script on the network and have now created a group that an email image is applied to through AD Security Groups. The script is executing fine, but it keeps asking used to save over the normal.dot file. Is there anyway to force Word to save it automatically without user intervention?

Here is the text in the file...

$objDoc.Saved = 1
$objWord.Quit

Top
#201634 - 2011-02-22 01:25 PM Re: Outlook Signature... conversion... [Re: pink_stig]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
We had the same issue. Word creates a temporary copy of the file if you open it. It does the same for the normal.dot file. When word is not closed properly the temp file is not deleted and it asks you to save the normal.dot file when closing word. To get around this I added a section to the script that deletes the temp file if it exists.

The $appdata variable gets filled earlier in the script. It is taken from %appdata%.

 Code:
;Check to see if the Word temp file exists.
If Exist($appdata + "\Microsoft\Templates\~$Normal.dot")
	;Delete Word temp file.
	Del $appdata + "\Microsoft\Templates\~$Normal.dot"
EndIf
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#201846 - 2011-04-04 03:52 PM Re: Outlook Signature... conversion... [Re: Mart]
pink_stig Offline
Fresh Scripter

Registered: 2010-09-01
Posts: 10
Loc: Lincoln
Thanks, I tried to put this in the other kix script that runs but it seems to not be working for a couple of users, I dont have any issues with it on my PC... the kix script that gets called look like this:

 Code:
 

;***************************************************************************
;****Add Email Signature using Kix Login
;****
;***************************************************************************

$objSysInfo     = CreateObject("ADSystemInfo")
$strUser 	= $objSysInfo.UserName
$objUser	= GetObject("LDAP://" + $strUser)
 
$strName 	= $objUser.FullName
$strSN 		= $objUser.sn
$strmobile 	= $objUser.mobile
$strTitle 	= $objUser.Title
$strDepartment 	= $objUser.Department
$strCompany 	= $objUser.Company
$strPhone 	= $objUser.telephoneNumber
$strGivenName 	= $objUser.givenname
$strMail 	= $objUser.mail
$strFax		= $objuser.facsimileTelephoneNumber
$strWeb		= $objUser.wWWHomePage

;Check to see if the Word temp file exists.
If Exist($appdata + "\Microsoft\Templates\~$Normal.dot")
	;Delete Word temp file.
	Del $appdata + "\Microsoft\Templates\~$Normal.dot"
EndIf

$objWord 	= CreateObject("Word.Application")
 
$objDoc 	= $objWord.Documents.Add()
$objSelection = $objWord.Selection
 
$objEmailOptions = $objWord.EmailOptions
$objSignatureObject = $objEmailOptions.EmailSignature
$objSignatureEntries = $objSignatureObject.EmailSignatureEntries

$objSelection.Font.Name = "Arial" 
$objSelection.Font.Size = "12"
$objSelection.Font.Color = "8421504"
$objSelection.Font.Bold = "1"
$objSelection.TypeText($strGivenName + " " + $strSN)

$objSelection.Font.Size = "12"
$objSelection.Font.Color = "8421504"
$objSelection.Font.Bold = "0"
$objSelection.TypeText(Chr(11))
$objSelection.TypeText($strTitle)

$objSelection.TypeText(Chr(11))
$objSelection.TypeText(Chr(11))

$objSelection.Font.Size = "14"
$objSelection.Font.Color = "8421504"
$objSelection.Font.Bold = "0"
$objSelection.TypeText(Benoy)
$objSelection.TypeText(Chr(11))

$objSelection.Font.Size = "7.5"
$objSelection.Font.Color = "8421504"
$objSelection.Font.Bold = "0"
$objSelection.TypeText("Design  Architecture  Masterplanning  Interiors  Graphics")
$objSelection.TypeText(Chr(11))

$objSelection.TypeText(Chr(11))

$objSelection.Font.Size = "8"
$objSelection.Font.Color = "8421504"
$objSelection.Font.Bold = "0"
$objSelection.TypeText("Winner - Queen's Award for Enterprise: International Trade 2008")
$objSelection.TypeText(Chr(11))
$objSelection.TypeText(Chr(11))


$objSelection.TypeText("T: " + $strPhone)
$objSelection.TypeText(Chr(11))


$objSelection.TypeText("F: " + $strfax)
$objSelection.TypeText(Chr(11))
$objSelection.TypeText(Chr(11))


$objSelection.TypeText($strWeb)
$objSelection.TypeText(Chr(11))
$objSelection.TypeText(Chr(11))

;add the image to the signature
$objShape = $objSelection.InlineShapes.AddPicture("\\servername\NETLOGON\Signature_image\Default\signature_image.gif")
$objLink = $objDoc.Hyperlinks.Add($objShape, "mailto:first.last@@emailaddress.com")


$objSelection.TypeText(Chr(11))

;adds the tree webding to the signature
$objSelection.Font.Name = "Webdings"
$objSelection.Font.Size = "18"
$objSelection.Font.Color = "13421619"
$objSelection.Font.Bold = "1"
$objSelection.Font.Italic = "1"
$objSelection.TypeText("P")


$objSelection.Font.Name = "Arial"
$objSelection.Font.Size = "8"
$objSelection.Font.Color = "13421619"
$objSelection.Font.Bold = "0"
$objSelection.Font.Italic = "0"
$objSelection.TypeText("   Please consider the environment - only print this e-mail if absolutely necessary")

$objSelection = $objDoc.Range()
 
;this specifies what the signature is the be called and whether you want it to apply to forward and reply etc
$objSignature=$objSignatureEntries.Add("company_image", $objSelection)
$objSignatureObject.NewMessageSignature = "company_image"
$objSignatureObject.ReplyMessageSignature = "company_image"
 
$objDoc.Saved = 1
$objWord.Quit



Is this correct? I dont need to add this to kix script I use as I dont get the save as problem, it runs fine without it?!? It hasnt made any difference to the guys that are having the issue, or do I need to amend the script slightly?

Top
#201847 - 2011-04-04 04:47 PM Re: Outlook Signature... conversion... [Re: pink_stig]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
 Originally Posted By: pink_stig

....do I need to amend the script slightly?


Yes. In my example I use the variable $appdata. It gets filled earlier in the script with the contents of the environment variable %appdata%. In your script $appdata is not filled. You can use environment variables directly in kix but I prefer to always use them in a kix style variable.

Here is how I fill $appdata with the correct data.
 Code:
$appdata = %appdata%


It puts the contents of %appdata% into $appdata. If you don’t do this then the variable $appdata will be empty and deleting the file will fail. No big deal for the people that do not have issues but it also does not fix it for those who have the “Save as...” issue. It does not throw an error and stop because it is correct kix syntax but it will give you an error code and description when looking at @error and @serror.


Edited by Mart (2011-04-04 04:56 PM)
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
Page 1 of 1 1


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
1 registered (Allen) and 1198 anonymous users online.
Newest Members
M_Moore, BeeEm, min_seow, Audio, Hoschi
17883 Registered Users

Generated in 0.072 seconds in which 0.026 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org