Forcing MSWord to open a document with a set font (ignoring the one within the file)
As per my previously (unanswered question) I'm exploring a different path.
开发者_StackOverflow中文版Is it possible to force MS Word to ignore the font size within a file and apply its own when the file is being opened? I understand this could get messy (registry hacks etc) but I would like to know of its feasibility.
ForEachLoop's answer is about right, there is no way to launch word in such a way as to cause it to replace fonts, or any other formatting. You'll have to launch an autostart macro of some sort to reformat the doc automatically.
Put the following code in a code module of the document, or code module in a template attached or opened by the document:
Public Sub AutoOpen()
ActiveDocument.Range.Font.Size = 20
End Sub
精彩评论