开发者

Forcing MSWord to open a document with a set font (ignoring the one within the file)

开发者 https://www.devze.com 2023-02-08 15:19 出处:网络
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

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
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号