2012-10-22 80 views
0

我使用VBS推給我們的用戶在Outlook中創建的簽名工作的Outlook簽名。簽名中有這樣我就可以有並排標誌/用戶側信息與上一個標誌上方的標準文本表。 (原表的代碼在這裏找到:http://www.vbforums.com/showthread.php?526706-resolved-question-with-tables-in-vbscript-for-AD-signature創建使用表格

下面是寫到doc文件的代碼的snipit。該代碼成功創建了兩個coluns,並將我想要的任何信息放入其中。問題是,如果我在輸入Table 1和Table的頂部的水平行,在這兩個表之間的間隙。我的問題是,你可以使用vbs來控制文檔的兩個表之間的差距嗎?

objDoc.Tables.Add objRange, 1, 2 
Set objTable = objDoc.Tables(1) 

'** Logo column ** 
'Draw a horizontal line (This only draws it for this frame) 
objSelection.InlineShapes.AddHorizontalLineStandard 

objTable.Cell(1, 1).select 
'Put Logo information here 

'** User column ** 
'Draw a horizontal line (This only draws it for this frame) 
objSelection.InlineShapes.AddHorizontalLineStandard 

objTable.Cell(1, 2).select 
'Put User information here 

objSelection.EndKey 6 'Command to end the above tables 

回答

0

此代碼實際上是VBA和技巧有記錄的話,不只是你奮鬥與一兩件事,消除間隙的宏。因此,手動創建表,找出去除的差距,然後記錄這個動作的最佳途徑。然後查看生成的宏,查看使用的vba代碼並將其插入腳本中。如果有效,請在此處發佈您的解決方案。 成功。

0

我無法讓自己的行手工創建一個Word文檔時,觸碰。但是,我完全通過迴避上述問題來回答自己的問題。我在表格上添加了一行。

鏈接:Add Text Above MSWord Table Using VBS