How to change font size of all text in MS Word using VBA?











up vote
-1
down vote

favorite












I opened an MS Word Document using Excel VBA. I'm trying to change the font size of the text inside the ms word doc that I opened using VBA.
Here's my code:



Sub Validator()
Dim doc As Word.document
lngAccountCounter = 3
Dim wordapp As Word.Application

Set wordapp = New Word.Application
wordapp.documents.Open ThisWorkbook.Path & "Account.doc"
wordapp.Visible = True
wordapp.Activate

With wordapp.Selection
.Font.Size = 7
End With
End Sub









share|improve this question
























  • Can you please edit your question so we know what the question is? At the moment, we don't know). While you're at it, you can also either remove the Excel tags or explain how this has to do with Excel
    – cybernetic.nomad
    Nov 9 at 16:36










  • Hi sorry for the ambiguity. I changed it, I hope you understood it. I'm trying to change the font size of the text in the word doc to size 7.
    – Robin Scherbatsky
    Nov 9 at 16:39















up vote
-1
down vote

favorite












I opened an MS Word Document using Excel VBA. I'm trying to change the font size of the text inside the ms word doc that I opened using VBA.
Here's my code:



Sub Validator()
Dim doc As Word.document
lngAccountCounter = 3
Dim wordapp As Word.Application

Set wordapp = New Word.Application
wordapp.documents.Open ThisWorkbook.Path & "Account.doc"
wordapp.Visible = True
wordapp.Activate

With wordapp.Selection
.Font.Size = 7
End With
End Sub









share|improve this question
























  • Can you please edit your question so we know what the question is? At the moment, we don't know). While you're at it, you can also either remove the Excel tags or explain how this has to do with Excel
    – cybernetic.nomad
    Nov 9 at 16:36










  • Hi sorry for the ambiguity. I changed it, I hope you understood it. I'm trying to change the font size of the text in the word doc to size 7.
    – Robin Scherbatsky
    Nov 9 at 16:39













up vote
-1
down vote

favorite









up vote
-1
down vote

favorite











I opened an MS Word Document using Excel VBA. I'm trying to change the font size of the text inside the ms word doc that I opened using VBA.
Here's my code:



Sub Validator()
Dim doc As Word.document
lngAccountCounter = 3
Dim wordapp As Word.Application

Set wordapp = New Word.Application
wordapp.documents.Open ThisWorkbook.Path & "Account.doc"
wordapp.Visible = True
wordapp.Activate

With wordapp.Selection
.Font.Size = 7
End With
End Sub









share|improve this question















I opened an MS Word Document using Excel VBA. I'm trying to change the font size of the text inside the ms word doc that I opened using VBA.
Here's my code:



Sub Validator()
Dim doc As Word.document
lngAccountCounter = 3
Dim wordapp As Word.Application

Set wordapp = New Word.Application
wordapp.documents.Open ThisWorkbook.Path & "Account.doc"
wordapp.Visible = True
wordapp.Activate

With wordapp.Selection
.Font.Size = 7
End With
End Sub






vba excel-vba ms-word






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 9 at 17:14









Cindy Meister

13.4k101934




13.4k101934










asked Nov 9 at 16:28









Robin Scherbatsky

83




83












  • Can you please edit your question so we know what the question is? At the moment, we don't know). While you're at it, you can also either remove the Excel tags or explain how this has to do with Excel
    – cybernetic.nomad
    Nov 9 at 16:36










  • Hi sorry for the ambiguity. I changed it, I hope you understood it. I'm trying to change the font size of the text in the word doc to size 7.
    – Robin Scherbatsky
    Nov 9 at 16:39


















  • Can you please edit your question so we know what the question is? At the moment, we don't know). While you're at it, you can also either remove the Excel tags or explain how this has to do with Excel
    – cybernetic.nomad
    Nov 9 at 16:36










  • Hi sorry for the ambiguity. I changed it, I hope you understood it. I'm trying to change the font size of the text in the word doc to size 7.
    – Robin Scherbatsky
    Nov 9 at 16:39
















Can you please edit your question so we know what the question is? At the moment, we don't know). While you're at it, you can also either remove the Excel tags or explain how this has to do with Excel
– cybernetic.nomad
Nov 9 at 16:36




Can you please edit your question so we know what the question is? At the moment, we don't know). While you're at it, you can also either remove the Excel tags or explain how this has to do with Excel
– cybernetic.nomad
Nov 9 at 16:36












Hi sorry for the ambiguity. I changed it, I hope you understood it. I'm trying to change the font size of the text in the word doc to size 7.
– Robin Scherbatsky
Nov 9 at 16:39




Hi sorry for the ambiguity. I changed it, I hope you understood it. I'm trying to change the font size of the text in the word doc to size 7.
– Robin Scherbatsky
Nov 9 at 16:39












1 Answer
1






active

oldest

votes

















up vote
0
down vote



accepted










You can change this



With wordapp.Selection
.Font.Size = 7
End With


To



ActiveDocument.Select
Selection.WholeStory
Selection.Font.Size = 7





share|improve this answer





















    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














     

    draft saved


    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53229662%2fhow-to-change-font-size-of-all-text-in-ms-word-using-vba%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote



    accepted










    You can change this



    With wordapp.Selection
    .Font.Size = 7
    End With


    To



    ActiveDocument.Select
    Selection.WholeStory
    Selection.Font.Size = 7





    share|improve this answer

























      up vote
      0
      down vote



      accepted










      You can change this



      With wordapp.Selection
      .Font.Size = 7
      End With


      To



      ActiveDocument.Select
      Selection.WholeStory
      Selection.Font.Size = 7





      share|improve this answer























        up vote
        0
        down vote



        accepted







        up vote
        0
        down vote



        accepted






        You can change this



        With wordapp.Selection
        .Font.Size = 7
        End With


        To



        ActiveDocument.Select
        Selection.WholeStory
        Selection.Font.Size = 7





        share|improve this answer












        You can change this



        With wordapp.Selection
        .Font.Size = 7
        End With


        To



        ActiveDocument.Select
        Selection.WholeStory
        Selection.Font.Size = 7






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 9 at 16:42









        Kubie

        1,130418




        1,130418






























             

            draft saved


            draft discarded



















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53229662%2fhow-to-change-font-size-of-all-text-in-ms-word-using-vba%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Schultheiß

            Verwaltungsgliederung Dänemarks

            Liste der Kulturdenkmale in Wilsdruff