在這種情況下(從Word的角度來看)的問題不是表格佈局 - 它是段落佈局。每個段落都有左右的大量縮進,並且前後的空間比您通常想要的要多。
我不認爲Word中的任何粘貼選項(例如選擇性粘貼)會幫助您,除非您粘貼爲未格式化的文本,然後選擇文本,轉換爲表格,然後從此處繼續。
但是,即使是一個簡單的Word VBA宏,比如這個,也會給你一些更易於管理的東西。 (選擇您複製的表格,然後運行宏)。在代碼上做更多的工作可能會讓你在大多數時間獲得大部分你想要的格式。
Sub fixupSelectedTable()
With Selection.Tables(1).Range.ParagraphFormat
.LeftIndent = 0
.RightIndent = 0
.SpaceBefore = 0
.SpaceAfter = 0
.LineSpacingRule = wdLineSpaceSingle
End With
End Sub
如果你比較熟悉的AppleScript,等效看起來是這樣的:
-- you may need to fix up the application name
-- (I use this to ensure that the script uses the Open Word 2011 doc
-- and does not try to start Word for Mac 15 (2016))
tell application "/Applications/Microsoft Office 2011/Microsoft Word.app"
tell the paragraph format of the text object of table 1 of the text object of the selection
set paragraph format left indent to 0
set paragraph format right indent to 0
set space before to 0
set space after to 0
set line spacing rule to line space single
end tell
end tell
我不熟悉,除了(贏)字這個問題什麼,但是......能你以字符分隔格式輸出表格數據?要麼作爲文件或字符串?如果是,那麼可以將其插入/寫入文檔並使用Word對象模型的ConvertToTable方法轉換爲表格。 –
爲什麼downvote? – Richard