-1

I have no experience nor any idea about VB scripts but I was tasked to create a .vbs file wherein when I double-click that file, it will automatically change the default font in Outlook 2016 to Montserrat. I've been picking up the pieces of whatever resource I could find online but it seems that the scripts I'm making do not change anything particular nor any message that it really ran successfully. I'm basically double-clicking the .vbs scripts I made and nothing happens. Below is what I had so far but I was told that that the .DefaultFont feature is not supported.

Sub ChangeFont()
    Dim objOLApp
    Dim NewTask
    Set objOLApp = CreateObject("Outlook.Application")
    Set NewTask = objOLApp.CreateItem(0)

    with Newtask
        .DefaultFont = "Montserrat"
    End With

    On Error GoTo 0
    Set objOLApp = Nothing
    Set NewTask = Nothing
END Sub

Basically what happens is when I run the script then open Outlook 2016, all the font configs will be set to Montserrat style like in the image below:

enter image description here

Is there any starting point anyone can recommend for this? Been stuck in this task for weeks. Thank you in advance.

I've already tried several code snippets I outsourced on the documentation and available resources online. Some kind-of makes sense to me but I'm not really sure how to match the pieces. I was expecting to create a .vbs file wherein when I double-click that file or open the file, the fonts of the running Outlook instance messages would change from the default font to Montserrat. I'm not really sure if this is possible but any help is highly appreciated.

  • Please don’t post duplicate questions, instead [edit](https://stackoverflow.com/posts/74400820/edit) the original and correct any issues that led you to post a duplicate. – user692942 Nov 12 '22 at 23:01
  • This is not a duplicated post. – Eugene Astafiev Nov 13 '22 at 19:33
  • @EugeneAstafiev explain what makes this different when the two questions are from the same OP, involve the exact same issue and are posted days apart? – user692942 Nov 13 '22 at 20:01
  • The second post clarifies things that was not mentioned in the first one. I see the difference. The author understood the answer given on the first post and decided to ask more precise question. – Eugene Astafiev Nov 13 '22 at 20:31
  • So [edit](https://stackoverflow.com/posts/74400820/edit) the first one to add clarity, there is no justifiable argument for this approach. It is a duplicate question. That goes for the OPs question and your original answer. – user692942 Nov 14 '22 at 07:54

1 Answers1

0

First, in the code you are creating a new MailItem instance, not a task item like it was named.

Second, Outlook items like MailItem or TaskItem don't provide the DefaultFont property.

Third, I've already described possible ways of changing the font-related properties in Outlook. Check out your post - Automatically Change Default Font of Outlook 2016 using Visual Basic Script. In brief, you can use the HTML markup to specify a custom font or use the Word object model to deal with item bodies.

Fourth, you can find some Outlook settings in the Windows registry. So, to locate where exactly Outlook keeps Outlook settings I'd suggest using the Process Monitor utility, so you could do the required changes in the UI and track where they are saved.

You may also find similar questions posted over the internet, see Set Font Style and Size of email message called from VB.net.

Eugene Astafiev
  • 47,483
  • 3
  • 24
  • 45