本文介绍了是否有替代创建依赖于Wordpad而不是Word的RTF文档?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
' This code creates an RTF document in the next to last line. This requires
' that Word is installed. Is there a different way that requires only Wordpad
' because it is usually present when office is not installed?
' Create document.
WordApp = CreateObject("Word.Application")
If WordApp.Visible = True Then WordApp.Visible = False
WordApp.Assistant.Visible = False
thisDoc = WordApp.Documents.Add
thisDoc.PageSetup.PaperSize = Microsoft.Office.Interop.Word.WdPaperSize.wdPaperLetter
thisDoc.PageSetup.TopMargin = 0
thisDoc.PageSetup.BottomMargin = 0
thisDoc.PageSetup.HeaderDistance = 0
thisDoc.PageSetup.FooterDistance = 0
thisDoc.PageSetup.LeftMargin = 72
thisDoc.PageSetup.RightMargin = 72
thisDoc.Range.InsertBefore(currentName)
thisRange = thisDoc.Paragraphs.Item(1).Range
thisRange.Font.Name = "Segoe UI Semibold"
thisRange.Font.Bold = True
thisRange.Font.Size = 14
thisRange.ParagraphFormat.Alignment _
= Microsoft.Office.Interop.Word.WdParagraphAlignment.wdAlignParagraphLeft
' Save document.
frmSrv1.Text = "Saving document..."
TopicFileName = topicDir & "\" & srvFilesFldN & "\" & progID & thisAppID & topicN & "." & srvExt
thisDoc.SaveAs(TopicFileName, RichTextBoxStreamType.RichText)
thisDoc.Close
推荐答案
这篇关于是否有替代创建依赖于Wordpad而不是Word的RTF文档?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!