簡體   English   中英

VB.net應用程序正在頁面上移動文字圖像和表格位置

[英]VB.net application is moving word images and tables locations on the page

我正在使用此代碼在vb.net中打開Word文檔,然后將其保存為其他文件名

Dim oWord As New word.Application
Dim oDoc As word.Document
oWord.Visible = False

oDoc = oWord.Documents.Open("c:\integra-billing\integra-invoice-summary.docx", False, True)

/// some code here to add/change content in the document ///

filename = "c:\integra-billing\detail\VoIP" + " -" + customer_sequence + ".doc"
oDoc_detail.SaveAs(FileName:=filename, FileFormat:=word.WdSaveFormat.wdFormatDocument97)
oWord_detail.Documents.Close(word.WdSaveOptions.wdDoNotSaveChanges)
oWord_detail.Quit()
oWord_detail = Nothing

保存文件后,它會將我的表格和圖像向下移動到頁面上,而不是放在正確的位置。

我怎樣才能阻止它改變事物的位置。

可能是由於將文件格式從docx更改為doc以防止此更改而引起的:

filename = "c:\integra-billing\detail\VoIP" + " -" + customer_sequence + ".docx"
oDoc_detail.SaveAs(FileName:=filename, FileFormat:=word.WdSaveFormat.wdFormatXMLDocument)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM