0
我试图以编程方式将构建块插入到使用VBA的Microsoft Word中,并且当插入工作时,在打印预览中查看时以及打印时,不会显示构建块。VBA插入的构建块不打印
Sub draw_point()
Dim objTemplate As Template
Dim objBB As BuildingBlock
Selection.MoveDown Unit:=wdLine, Count:=1
' Set the template to store the building block
Set objTemplate = ActiveDocument.AttachedTemplate
' Access the building block through the type and category
Set objBB = objTemplate.BuildingBlockTypes(wdTypeAutoText) _
.Categories("General").BuildingBlocks("point")
' Insert the building block into the document replacing any selected text.
objBB.Insert Selection.Range
End Sub
如果我手动插入积木,它打印的很好。
我通过插入一个形状,然后将其添加到
AutoText > General > Normal.dotm > Insert content only
创建积木如果我尝试一个新的文档重新创建这个问题,它不会发生,但我不能确定这两个文档之间的属性不同
当您手动插入它时,你插入在完全相同的地方?当你从你的代码中插入它时,它会被插入到字体被隐藏的段落中? –
形状被插入隐藏字体的表格单元格中。修好后,它现在打印。如果你想写一个答案,我会除了它。 – CDO
谢谢,正式答复! –