我正在使用 VBS 在 Outlook 中创建签名以推送给我们的用户。签名中有表格,因此我可以将徽标/用户信息与徽标顶部的标准文本并排放置。(原始表格代码在这里找到:http ://www.vbforums.com/showthread.php?526706-resolved-question-with-tables-in-vbscript-for-AD-signature )
下面是写入 doc 文件的代码片段。该代码成功地创建了两个列,并将我想要的任何信息放入其中。有没有办法在开始创建/编辑表格之前将文本添加到 doc 文件的顶部?
Set objWord = CreateObject("Word.Application")
objWord.Visible = True
Set objDoc = objWord.Documents.Add()
Set objSelection = objWord.Selection
objSelection.Style = "No Spacing"
Set objRange = objDoc.Range()
Set objEmailOptions = objWord.EmailOptions
Set objSignatureObject = objEmailOptions.EmailSignature
Set objSignatureEntries = objSignatureObject.EmailSignatureEntries
'I want to add text here above the two tables below. Not sure how to do it.
'Create Tables
objDoc.Tables.Add objRange, 1, 2
Set objTable = objDoc.Tables(1)
'** Logo table **
objTable.Cell(1, 1).select
'Put Logo information here
'** User table **
objTable.Cell(1, 2).select
'Put User information here
objSelection.EndKey 6 'Command to end the above tables