It was a tie between SuperUser SE or this one - I feel like I would get better results here. My question is regarding the use of baselines, but keep in mind that I have a copy of MSOffice 2016 Home & Student.

I'm attempting to write VBA to perform individual character adjustment within my entire document:

Sub RandomizeBaseline()
    Dim rng As Range
    Dim char As Variant
    Dim baseline As Double
    Set rng = ActiveDocument.Range
    For Each char In rng.Characters
        baseline = Rnd() * 2 - 1
        char.Font.Position = baseline
    Next char
End Sub

The intention of this to begin with is to make a document look as if it was typed on a typewriter. I've already got a monospace font to work with, but with the way that MSWord parses this makes the randomized baseline values either -1, 0, or 1. Setting these to decimal values to make the baseline shift less dramatic apparently truncates to just zero and doesn't shift anything at all. The code does parse through, but there is no visible different. How should I fix this for my intended ultra specific project?

  • Hi. Welcome to GDSE. The problem is that MS Office isn't really a graphic design tool. Also coding is generally off-topic here. SuperUser might be better for this to be honest.
    – Billy Kerr
    Jun 28, 2023 at 10:28
  • Might actually be possible to find a font that has actual wonky typewriter characters. Like this one
    – Billy Kerr
    Jun 28, 2023 at 10:35
  • @BillyKerr Thank you for the suggestion. I'll see what SU has to say.
    – anon5001
    Jun 28, 2023 at 14:53


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.