Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 533887
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T09:33:17+00:00 2026-05-13T09:33:17+00:00

We are using VB6 and Word.Basic object to create documents. Text is inserted at

  • 0

We are using VB6 and Word.Basic object to create documents. Text is inserted at a variety of bookmarks. Our latest requirement wants us to increase the font size for a given insert. We are currently doing this by setting the font size to 12 rather than the 8 that is normally there, however from a maintenance standpoint, I would rather be able to set this to say (currentfontsize + 4)… but so far I have not been able to find any method to get the current font size.

Does anyone have a way to do this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T09:33:18+00:00Added an answer on May 13, 2026 at 9:33 am

    Setting the font size of a bookmark is straight-forward in VBA:

    Dim doc As Document
    
    Const MultiSelection As Long = 9999999
    
    Set doc = Application.ActiveDocument
    
    If doc.Bookmarks.Exists("myBookmark") Then
        If doc.Bookmarks("myBookmark").Range.Font.Size = MultiSelection Then
            ' the range of the bookmark consists of runs with different font sizes
            doc.Bookmarks("myBookmark").Range.Font.Size = 12
        Else
            doc.Bookmarks("myBookmark").Range.Font.Size _
                = doc.Bookmarks("myBookmark").Range.Font.Size + 4
        End If
    End If
    

    Probably a better option if you want to increase the font size proportionally, is to use Font.Grow which will increase the font size to the next available size, e.g. to get from 8 to 12 you would have to call it 4 times.

    If doc.Bookmarks.Exists("myBookmark") Then
        For i = 1 To 4
            doc.Bookmarks("myBookmark").Range.Font.Grow
        Next
    End If
    

    If you are not familiar with Word’s object model, a trick is to use the Macro Recorder. In you case, start the recorder, open the bookmarks dialog, go to the bookmark and then change the font size. The recorded actions will be saved as a module in your Normal.dot file by default. The action of changing the font size of a bookmark would result in the following recorded macro:

    Selection.GoTo What:=wdGoToBookmark, Name:="myBookmark"
    With ActiveDocument.Bookmarks
        .DefaultSorting = wdSortByName
        .ShowHidden = False
    End With
    Selection.Font.Size = 12
    

    This code can be the basis for your own function (although it looks a bit different from the above sample, the effect will be the same).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 313k
  • Answers 313k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer day was switched with month all the time That sounds… May 13, 2026 at 10:47 pm
  • Editorial Team
    Editorial Team added an answer or just use a custom one from: http://code.google.com/p/androidtabs/ it allows… May 13, 2026 at 10:47 pm
  • Editorial Team
    Editorial Team added an answer If you are using a network queue, you cannot start… May 13, 2026 at 10:47 pm

Related Questions

We have a new build machine to start using for our programming team. We
I'm working on a fairly large project for a trading company in Philadelphia. The
I am looking for information on the best practices or project layout for software
We are using the builtin ftp in VB6. (Drag and drop control) The ftp
We have a large suite of apps, most are C# 1.1, but at least

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.