Jump to content
Fórum Script Brasil
  • 0

Dando Formato as Variaves ( Fonte / Cor ) .vbs


M Thiago

Question

Galera montei um script para configura assinatura dos usuários automaticamente, estou montando a mesma conforme quero porem eu não estou conseguindo dar formato diferente a pare do testo que é uma variável, alguém sabe se é possível formar uma variável para que ela tenha um fonte especifica e cor e tal ?

Segue o meu código.

Este código busca informações do AD e gera uma assinatura no outlook do usuário !

arquivo.vbs !

Const END_OF_STORY = 6

On Error Resume Next

Set objSysInfo = CreateObject("ADSystemInfo")

strUser = objSysInfo.UserName

Set objUser = GetObject("LDAP://" & strUser)

With objUser

strName = .FullName

' strTitle = .Description

End With

With objNomecomp

strnome = objuser.CN

.Name = "Tahoma"

.Size = 11

.Bold = true

.Color = RGB(0,0,128)

End With

strCompany = objUser.Company

strAddress = objUser.streetAddress

strpostalCode = objUser.postalCode

strDep = objUser.Departamento

strl = objUser.l

strco = objUser.co

strPhone = objUser.TelephoneNumber

strFax = objUser.facsimileTelephoneNumber

strMail = objuser.mail

strWeb = objuser.wWWHomePage

strnome = objuser.CN

strDep = objuser.department

strWeb = "www.santaclarasa.com.br"

srtCel = objUser.mobile

strTel = "Tel. 55"

strnome.Bold = false

Set objword = CreateObject("Word.Application")

With objword

Set objDoc = .Documents.Add()

Set objSelection = .Selection

Set objEmailOptions = .EmailOptions

Set objRange = objDoc.Range()

objDoc.Tables.Add objRange,1,2

Set objTable = objDoc.Tables(1)

End With

Set objSignatureObject = objEmailOptions.EmailSignature

Set objSignatureEntries = objSignatureObject.EmailSignatureEntries

With objSelection

objTable.Rows.Add()

objDoc.Hyperlinks.Add objSelection.InlineShapes.AddPicture("\\192.168.0.3\Pub\Tecnologia da Informação\Scripts\assinaturalogo.jpg"), strweb

'objTable.Cell(1, 1).Range.Text = objSelection.InlineShapes.AddPicture("\\portoserver01\temp$\LogoAssinatura11.jpg")

'objTable.Cell(1, 1).Hyperlinks.Add = objSelection.InlineShapes.AddPicture("\\portoserver01\temp$\LogoAssinatura11.jpg")

.ParagraphFormat.Alignment = wdAlignParagraphRight

.TypeParagraph

objSelection.Font.Color

obje

'objTable.Cell(1, 2).Range.Font.Bold = true

objTable.Cell(1, 2).Range.Font.Size = "10"

objTable.Cell(1, 2).Range.Font.Name = "Tahoma"

objTable.Cell(1, 2).Range.Font.Color = RGB(0,0,128)

objTable.Columns(1).Width = objWord.InchesToPoints(1)

objTable.Cell(1, 2).Range.Text = strnome & Chr(11) & strDep & Chr(11) & "Tel. 55 " & strPhone & Chr(11) & "Fax. 55 " & strFax & Chr(11) & strMail & Chr(11) & strWeb

If Len(srtCel) <> 0 then

objTable.Cell(1, 2).Range.Text = strnome & Chr(11) & strDep & Chr(11) & "Tel. 55 " & strPhone & " | " & srtCel & Chr(11) & "Fax. 55 " & strFax & Chr(11) & strMail & Chr(11) & strWeb

end if

objSelection.EndKey END_OF_STORY

End With

Set objSelection = objDoc.Range()

objSignatureEntries.Add "Assinatura Porto", objSelection

objSignatureObject.NewMessageSignature = "Assinatura Porto"

objSignatureObject.ReplyMessageSignature = "Assinatura Porto"

objDoc.Saved = True

objword.Quit

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Forum Statistics

    • Total Topics
      152.2k
    • Total Posts
      652k
×
×
  • Create New...