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
vba excel-vba ms-word
add a comment |
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
vba excel-vba ms-word
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 theExcel
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
add a comment |
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
vba excel-vba ms-word
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
vba excel-vba ms-word
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 theExcel
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
add a comment |
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 theExcel
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
add a comment |
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
add a comment |
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
add a comment |
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
add a comment |
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
You can change this
With wordapp.Selection
.Font.Size = 7
End With
To
ActiveDocument.Select
Selection.WholeStory
Selection.Font.Size = 7
answered Nov 9 at 16:42
Kubie
1,130418
1,130418
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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