View Single Post
 
Old 04-04-2018, 07:06 AM
BLUEPUPIL BLUEPUPIL is offline Windows 7 64bit Office 2016
Novice
 
Join Date: Feb 2016
Posts: 20
BLUEPUPIL is on a distinguished road
Default

The long story short: I'm making attempt to migrate from WordPerfect to MS Word.
In WP I use macros. Because macro recorder in Word don't record properly mouse movements and clicks, I've got some difficulties, for I am not familiar with VBA.

For great part of my macros, I've found a bypass- using Styles and assigning shortcut keys. However, I was unable to include in Styles possibilities to highlight text and to insert text boxes. Highlighting text was relatively easy to achieve using macro recorder.

And remains one final hurdle- to create a macro which inserts text box with specific text- hence this thread and the need for YOUR HELP.

I've made a screen picture to visualize the text box. It's positioned between two horizontal lines and wrap is set to- *in front of text*. The ideal behavior of the macro will be as follows:
after putting the blinking cursor somewhere between letters in a word or select a word- execution of the macro will place the text box just above the word in the space between two horizontal lines.

I'm assuming that such macro is impossible (I may be wrong), because each time the insertion horizontal point is altered and floats according to the cursor position (vertical position keeps the same value - exact vertical position between two horizontal lines) and came up with compromise- according to macro layout it's possible to determine the vertical position of the text box as *Absolute* and *0.42" below Line* and horizontal as *Relative* and *35% relative to Page*.

These figures are taken from # More Layout Options> Layout> Position # of the text box from the picture. I'm bringing here the complete characteristics of the text box, hoping that YOU will help me to organize them in VBA script.

==============
1.Insert a text box between two horizontal lines- The exact position is predetermined or if possible is floating horizontally
relative to the cursor position.
2.Text box layout options.
2.1.Position- horizontal- *Relative position- 35% relative to Page*; vertical- *Absolute position- 0.42" below Line*; Options- Move object with text- yes; Allow overlap- yes.
2.2.Text Wrapping- *In front of text*;
2.3.Size- Height- *Absolute-1"* Width- *Absolute-3"* Rotate- *Rotation-0* Scale- Height-100%; Width-100%.
3.Format shape.
3.1.Fill- No fill;
3.2.Line- No line;
4.Font in the text box
4.1.Font- *CollegiateInsideFL*;
4.2.Font size- 30;
4.3.Font color-
There are three colors.
Each one of the three figures has separate color:
First one (10.)-R,G,B= 250,100,0;
Second(20.)-R,G,B= 0,176,240;
Third(30.)-R,G,B= 146,208,80;
4.4.Text effects- Text Outline- *Solid line*- Color-R,G,B= 0,0,0; Transparency- 0%; Width- 1.5pt.
=======================

Last edited by Charles Kenyon; 04-04-2018 at 08:52 AM. Reason: Add paragraph breaks to make more readable.
Reply With Quote