![]() |
|
#1
|
|||
|
|||
|
Hi all! I'm developing a script to make a doc more hand-written like. I originally used randomization to alter the position of each character. Yet, the result is a bit weird since common people write in a line that is oscillating rather than random.
Here is the original code: Code:
Sub HandWrittenSimulation()
Dim R_Character As Range
Dim ParagraphSpace(3)
ParagraphSpace(1) = "11"
ParagraphSpace(2) = "12"
ParagraphSpace(3) = "13"
For Each R_Character In ActiveDocument.Characters
VBA.Randomize
R_Character.font.Position = Int(VBA.Rnd * 3) + 1
R_Character.font.Spacing = 0
Next
Application.ScreenUpdating = True
For Each Cur_Paragraph In ActiveDocument.Paragraphs
Cur_Paragraph.LineSpacing = ParagraphSpace(Int(VBA.Rnd * 3) + 1)
Next
Application.ScreenUpdating = True
End Sub
Since I assume the natural paragraph will break the continuity, I think just randomize the 1st character of every paragraph should work. Thank you very much XD Last edited by puff; 06-13-2018 at 05:07 PM. |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Textboxes position isn't equal to initial position | dxdevil | Word VBA | 0 | 01-30-2017 04:32 AM |
| Shadow Position | shanemarkley | Excel | 0 | 07-30-2014 08:23 PM |
Hyperlink goes to wrong position
|
Stephen0352 | Word | 6 | 10-03-2012 04:41 AM |
VBA: how can I know the position on a document?
|
tinfanide | Excel Programming | 3 | 02-27-2012 03:24 PM |
| fix position for a segment in a doc | tai | Word | 3 | 10-20-2011 01:04 PM |