最近我們升級了一個我們的PowerPoint插件,以支持2007年和2010年。我們能夠移植的大多數項目沒有問題。我們遇到的一個問題是,使用插件創建表格或形狀時,縮進不起作用。PowerPoint編程:標尺邊距水平縮進不起作用?
爲如:同一個表被用正確的縮進下降在2003年,但同樣的事情沒有得到壓痕添加到使用2007
下面當是代碼片段,允許縮進:
With PropertyValues.ObjShape.Table.Cell(row, col).Shape.TextFrame.Ruler
For rulerCount = 0 To 5
.Levels(rulerCount).FirstMargin = rulerFirstMargin(rulerCount) '.LeftMargin = rulerLeftMargin
.Levels(rulerCount).LeftMargin = rulerLeftMargin(rulerCount) 'Left indent marker
Next rulerCount
End With
任何想法,爲什麼這是行不通的?
我閱讀下面的線程太多,但並沒有太大的幫助http://answers.microsoft.com/en-us/office/forum/office_2007-customize/why-shapetextframerulerlevelsi-cant-set-the-bullet/9eac3e46-b13b-433e-b588-216ead1d9c1a?tab=AllReplies#tabs
更新的代碼:
PropertyValues.ObjShape.Table.Cell(row, col).Shape.TextFrame.TextRange.Text = "N/A"
With PropertyValues.ObjShape.Table.Cell(row, col).Shape.TextFrame
'Dim rulerCount As Short
For rulerCount = 1 To 5
.Ruler.Levels(rulerCount).FirstMargin = 10 * rulerCount 'rulerFirstMargin(rulerCount) '.LeftMargin = rulerLeftMargin
.Ruler.Levels(rulerCount).LeftMargin = 20 * rulerCount 'rulerLeftMargin(rulerCount) 'Left indent marker
Next rulerCount
End With
PropertyValues.ObjShape.Table.Cell(row, col).Shape.TextFrame.TextRange.Text = text
史蒂夫感謝:
在這裏,我們試圖格式化每個縮進級別之前添加文本,並設置縮進級別。但請檢查上面更新的代碼。它也沒有工作。有什麼具體的我們必須做的。除此之外,如果我調試並看到左邊的價值..它說價值超出範圍?但即時設置值0,36,72,108,144 – Aneef
檢查我的帖子的編輯版本;這應該有所幫助。 –
嗨史蒂夫,謝謝你會檢查這一點,並更新你 – Aneef