添加word文档并保持格式 [英] Add word document and keep formatting
本文介绍了添加word文档并保持格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
pre $
objword1.Selection.InsertFile文件名:= cv1Address,_
ConfirmConversions:= False,Link:= False,附件:= False
解决方案
恐怕你不能使用InsertFile方法,但必须打开文件并复制并粘贴 wdFormatOriginalFormatting
我发现这个:
<$ c $ (设置rtffile = wdApp.Documents.Open(Filename:=C:\temp\rtf_stapler_problem\concat\cars2.rtf,ConfirmConversions:= False,ReadOnly:= True)
wdApp.Selection .WholeStory
wdApp.Selection.Copy
wdApp.ActiveWindow.Close savechanges:= wdDoNotSaveChanges
destdoc.Activate
wdApp.Selection.PasteAndFormat(wdFormatOriginalFormatting)
wdApp.Selection .InsertBreak类型:= wdSectionBreakNextPage
I am attempting to add my CV to the end of a document. The following code does just that but the formatting of the CV is messed up once it is inserted into the new document. Can I insert the file and keep the original formatting of the CV (I dont want to copy and paste from an open document):
objword1.Selection.InsertFile Filename:=cv1Address, _
ConfirmConversions:=False, Link:=False, Attachment:=False
解决方案
I'm afraid that you can't use the InsertFile-method but have to open the file and copy&paste with wdFormatOriginalFormatting
I have found this:
Set rtffile = wdApp.Documents.Open(Filename:="C:\temp\rtf_stapler_problem\concat\cars2.rtf", ConfirmConversions:=False, ReadOnly:=True)
wdApp.Selection.WholeStory
wdApp.Selection.Copy
wdApp.ActiveWindow.Close savechanges:=wdDoNotSaveChanges
destdoc.Activate
wdApp.Selection.PasteAndFormat (wdFormatOriginalFormatting)
wdApp.Selection.InsertBreak Type:=wdSectionBreakNextPage
这篇关于添加word文档并保持格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文