|
继续
End If 7 X! @; {5 Q& j
8 M- Z( @' L0 l( M v6 F If y = 1 Then
" l7 c2 K1 n2 y R* e& C% }! s$ S
4 ^* d3 r4 D; ^0 @ If ma.Borders(xlEdgeLeft).LineStyle
2 l1 P/ r- }) `! Q; N ^. B" I* P1 T! h7 u; G
< > xlNone Then
3 x# A8 A6 j" {2 ^! W7 c& I/ Q. G5 i% M! Q& T
ptArray(0) = xpoint 9 F4 [9 S# v% G0 w! y7 ~
z4 z, x# U, v0 s8 b ‘第四点坐标(数组下标 0 and 1) , v( b# R& q$ b7 Y! z! T
9 W; @' E6 C( \& N
ptArray(1) = ypoint - yh + u, p& {9 D( v% a. c7 e) V/ O
- W B/ H7 z, e
ptArray(2) = xpoint * T5 \8 ^. f: I6 h) Z" B) F
5 K3 j" d' i/ L3 M0 n5 @" _ I ‘第一点坐标(数组下标 2 and 3) ) Q! _7 G. r s7 l+ }+ B
1 T K4 c) i& C& O' w$ z ptArray(3) = ypoint ' u" @4 ?% ~7 d! t; d
V' [" l% B' S! }/ ` End If
) Q/ i4 |6 I: s% r& }& D) A
5 p+ K% O& h) Q+ M8 ~8 q2 N2 O Lineweight lwployobj, ma.Borders(xlEdgeLeft).Weight % r2 R6 j( V' G R. O; s
! P% P/ t" ~8 O
End If
1 e p8 y: C/ b- X( D
, F! c% m8 V7 H/ }3 a If ma.Borders(xlEdgeRight).LineStyle 2 e" u; M ]- c; U9 x z8 t
0 A+ d% x# r: x! N {- J. N/ h! h0 i < > xlNone Then 6 B( [# ?2 l, h$ N
# ~) Z9 S. ^& z4 u& ]7 U( s/ P$ d
ptArray(0) = xpoint + xh ' x0 h2 q$ |8 _2 `
7 r* |' y. K3 [$ V3 l. v q ‘第二点坐标(数组下标 0 and 1)
: [ i- m% H3 k" Z, {2 T" p) @) d0 ^) {
ptArray(1) = ypoint
6 h" Y& r0 v! s, Q/ X! R0 N! x& `; U
3 U4 \8 G' W) X2 w7 R ptArray(2) = xpoint + xh
+ G8 e1 @; _+ z& S/ O! V# z& {
‘第三点坐标(数组下标 2 and 3) " k D$ {, n" `3 j3 O0 W1 y
. x# y6 A( M- | j+ Z0 m* ^ ptArray(3) = ypoint – yh u3 u+ ~* i; G5 _$ \1 G
! L: w0 u$ P; n Lineweight lwployobj, " A0 W+ m2 r6 d n- d0 g w. Y/ O
/ E" m* F# ~3 X0 d- s7 C
ma.Borders(xlEdgeRight).Weight + p, Y/ ]* C# p9 Z! A
/ ^, Z' h9 U7 v) X/ R
End If & z0 c- r2 `" `6 N" X/ v' n- n7 b; I7 E
8 s; g6 j9 R* n, A5 c4 s) c& M Set lwployobj = moSpace.AddLightWeightPolyline(ptArray) & H& @6 ^7 {4 x+ j* ? k4 p% t8 d+ V
3 {8 G9 \ T( I4 \. M& b0 H4 |- d$ S
‘在AutoCAD文件里画线 5 _$ m5 Y% l# f/ h$ i# Y( ?
: T# e: M* W+ K m# _ T With lwployobj
( A" ]% T' O* F+ b9 q6 o" C, R; n: L' s8 w7 G
.Layer = newlayer.name ‘指定lwployobj所在图层
C$ S9 ?6 @/ Q, D( l% W; k/ q# C" V2 s
5 l& Y3 S7 `2 x' D) F& i .Color = acBlue ‘指定lwployobj的颜色 0 T2 C j* e; D. ^. B6 F$ d! B
8 B/ f9 S, u+ d7 ^
End With t9 ?6 W) I: g1 X( ]
) p: d7 \0 r9 M; K Lwployobj.Update 9 ?/ k' v. e0 N6 Y9 R9 J# ?) `
! L( ~- p8 r6 R8 l7 E7 q! H) q) }
Next y + H# M: }5 \6 ]8 L$ i" c2 `) c3 _+ u
( H* g- [9 M. t( \
Next x 0 ~" M8 S: `4 Z. p
/ ^' N9 C, _' W End Sub
6 s" j4 _- W* k+ N# E7 L3 B/ U2 W) X
, f* H9 X# M+ F5 T ‘下面程序控制线条粗细 ; n& {9 a/ j* a' U" B [9 O
' M' _$ g4 e, T, {; U Sub Lineweight(ByVal line As Object, u As Integer)
& ~+ L' f0 W+ Q
/ l9 k- j. x: D) o e5 B- @, X Select Case u
0 ]1 z- r4 P6 i8 X2 k$ A+ b( v1 q6 Z* l4 C3 `
Case 1 " C8 p8 ?. [4 e) U
, `# z, x5 ?3 d% A Call line.SetWidth(0, 0.1, 0.1)
& t; s# m7 f7 C" ]0 X' r" G/ r6 H
Case 2
# G M( Q$ J4 Q+ F3 `
+ k R# ?* E( O/ y& O0 l5 H* E9 \ Call line.SetWidth(0, 0.3, 0.3)
$ e/ v7 x8 E- I$ z- E5 x
+ i, x: h; Y( D) J- k' n0 @ Case -4138
# ?, t2 _ f+ s; n! @& Y/ F3 k3 ] Y2 x+ F( m$ b
Call line.SetWidth(0, 0.5, 0.5)
9 @4 @% \! B* W+ Y* ^
% {* z0 R/ G- I5 k1 Q; {# }+ y Case 4
m) @1 t4 w- \7 Q4 y* V0 }' P9 s1 V$ L, Z5 _: l9 n& t" b6 l3 S8 ~
Call line.SetWidth(0, 1, 1) 9 i2 g) b1 ^3 W3 @/ V+ X
) x/ G" K U. I& b7 S Case Else
8 x! j& K+ V) R1 o/ G" j9 ]% Z4 U% s) G. u M
Call line.SetWidth(0, 0.1, 0.1)
$ ]% P1 I6 Z7 V8 S, T. @5 L, t, N
& J' L' Q5 I- ? End Select
, C) W5 h" v) _ _- c
" r$ B% _- H% T End Sub
! C5 v0 Z- j7 r1 n* s% j/ D2 o' k$ z- F6 |( L: m5 S
‘下面程序完成列号转换
- W& O& t/ j( S7 ?+ p% a9 H1 i* l- }6 d. h, y8 W* N
Function zh(pp As Integer) As String
3 Y" m2 H* V6 }9 H5 e$ w, @" p9 @7 V3 s) u% ?3 t
If pp < 26 Then
5 n9 h1 i* N) \! f/ `, u" c. I! n9 d7 d( o; A3 L4 U# S) t; a! ?
zh = Chr(64 + pp)
) M# o: q# C) z5 r: m" \/ R3 A, H" b0 n6 J' U* }
Else & g7 _2 E/ X6 U m8 Q/ ^
, ]4 c/ m' g7 J9 ~# i; b/ ^; H zh = Chr(64 + Int(pp / 26)) + Chr(64 + pp Mod 26)
4 T1 |0 H( O; I2 `1 H+ G6 z# N# z6 ~# }
End If
& d9 V" b, |# H5 y/ V* T" s8 ~; O$ |3 L6 I$ Y
End Function 3 m, H' x: Q2 X6 O+ F
; W) [' E' S& q 3、表格文字转换 6 `& I1 R& }! u a! Z3 s
3 H/ [6 `& l5 |& c* b% q
表格文字转换包括表格文字本身转换和表格文字在表格中位置的转换两个部分。 " F7 z/ I! h5 K/ c" r: j1 [# g
; W: e% m+ A3 _$ e 在AutoCAD中,文字标注的形式有多种,与Microsoft Excel 单元格区域多行文本内容相对应的是多行文本命令。AutoCAD提供的VBA添加多行文本的命令语句是:) { Z6 F2 ~/ A2 H m9 n1 y
RetVal = object.AddMText(InsertionPoint, Width, Text) " t1 r. U5 s4 L
9 W3 j S. E" I! i
通过修改RetVal的属性可以控制表格文字在表格中的位置。 # X( H$ y0 J# n( V
1 \' B. Y- w& c) k r
(1).表格文字本身的转换 ' H! S' N8 Y ]" Q3 k2 K
/ ?1 S# j+ W; }5 _1 Z
分析AddMText命令可以得出:表格文字所在位置、文字内容宽度,文字内容,均可通过此命令来添加。然而表格文字字体,大小,下划线、上下脚标,倾斜,加粗等却不能。一般的方法是采用修改字体形文件的方法来实现,方法烦琐,不便于实现,而且仅对修改过形文件的字体有效。况且当同一文字块内的不同文字的字体,大小,下划线、上下脚标,倾斜,加粗不同时,使用修改字体形文件的方法也无法实现。本文介绍一种直接利用Mtext命令提供的方法进行转换。
- h+ s, ^( b7 d* j% y1 x8 @( e, _- X! @# w) R
在AddMText命令中,影响文字内容和文字属性的参数Text。在具体文字前加上一定的控制符号可以控制文字的文字属性,具体控制符号可以参阅AutoCAD帮助文件。例如,{\F宋体;\Q18;\W1.2;ABCDEFG}把“ABCDEFG”设置成宋体、向右倾斜18度,每个字的宽度是正常宽度1.2倍。
6 H; r0 |$ i. E* U* I0 t) \
; G$ `) h/ ? ]9 p0 w/ H i 本程序具体采用的方法是:读取Microsoft Excel文件某一单元格区域里的某第j个字符属性(字体,大小,下划线、上、下脚标,倾斜,加粗),读取Microsoft Excel文件某一单元格区域里的某第j+1个字符属性,如果与第j个字符相同,则二者采用同样的控制符号;若不同,则从第j+1个字符开始,重复前面的工作。 3 B% A; h3 b3 y' ^6 h
; U' r4 @; B! [5 ^
Sub wz ( ) . [$ b+ t/ B& _$ |8 h1 Y
# w) v! T! T. [ \, f
Char = RTrim(Left(c.Characters.Caption, 256))
0 q6 R, o& s/ X, D/ ~
+ i/ A3 h4 Q* b# i If Char < > Empty Then
/ G( d& H2 T; o$ c/ I
& y7 V) D7 a. V* @1 n$ ?3 s2 c! e7 V textStr = ""
5 w+ p' e, Q, P7 x" _; A) [# [; u1 _% u. S" }* O/ |& G$ e' u
For j = 1 To Len(Char) - d2 p$ z: ^" Q- t5 d) o$ N, q
4 z& A$ @, k5 C! }1 n) O If c.Characters(j, 1).Font.Underline = / f! V' N& }* X
" ]+ ?" f. @% D+ S+ f9 g
xlUnderlineStyleNone Then
% R& U" X8 s9 I9 r
2 h+ D+ d8 w: s8 Q. ] cpt = c.Characters(j, 1).Caption 3 g2 K: V! |! T: H) f
8 i% F; t7 v6 T
sonstr = ForeFontStr(c, j)
2 R6 ^& X+ G+ u6 U1 A' U0 J4 K
' b2 a `* u* H* d6 m5 ^/ d2 s5 e tempstr = "" 0 H2 Y, |: ~/ f8 A8 d4 Q
% _ x8 B& |) ?2 t; c7 I
Do While j + 1 < = Len(Char) % ]2 B$ t, w. |! c7 k
0 |3 s& d0 r+ z+ O) W5 g7 z1 R sonstr1 = ForeFontStr(c, j + 1)
$ P% T: v) f/ r: }* k; x4 q; c% I" B, e. I& R
If sonstr1 = sonstr Then
% Q+ F# c; E# }" Q0 Z5 H
4 N9 C5 H5 h4 j S6 k j = j + 1 $ o8 U* A1 p2 A8 U5 q0 [
s4 [5 m* V! O
tempstr = tempstr + c.Characters(j,
8 l, l, l3 A$ s8 i& k9 E
3 X8 ]+ E) S- A! a1 c 1).Caption
3 [% V/ H( w8 o7 D" H4 u8 j% _
, t( u8 a( b6 e% i6 ^- U" \ Else
1 f3 @1 H b: s4 g/ i y m1 C9 B4 D9 p
Exit Do
8 `0 @' b* A- F) l o
2 N/ D& N u! t5 X/ A9 D End If
1 d: I# o$ W. U2 E1 @
8 \6 e+ k6 p% J$ G& \: e' q Loop $ j% m1 |- k0 K7 [
$ j0 H7 A: f7 ^- z textStr = textStr + "{" + sonstr + cpt 6 ~3 I8 m. }; z. x: n/ Z1 a, A
: I ]9 U$ d# k# h& N1 N1 l
+ tempstr + "}"
5 |) R. T. R" H2 z5 X6 \1 f4 S+ D2 ]9 V( F
Else
% B1 q6 M& ~7 s8 b4 x
/ c4 Y- R( ]5 c: j1 i+ w n cpt = c.Characters(j, 1).Caption
+ D8 e2 o/ ^: G8 G l% p7 v5 b
' f9 ?; A) ]! ?0 E/ _+ [* P) B4 M% Q sonstr = ForeFontStr(c, j)
# B8 ?; R. G" a6 i f$ B e" {
7 z, M- e' ]. V tempstr = ""
* ^2 Q; U7 W3 \3 e4 p% f+ P7 r- d) B5 @2 Q% v5 i o
Do While j + 1 < = Len(Char)
' D- a! I) q: c- Z8 }' X+ C: J# Y3 d3 f/ E3 I6 ?" P5 ~; G
sonstr1 = ForeFontStr(c, j + 1)
) ^# k0 v4 y! q0 b/ t I a+ m k% k6 m0 f
If sonstr1 = sonstr Then # l+ Z9 }! H8 n1 Q
: O5 a" a D& K- Y& }4 j. h* i
j = j + 1 , w- S" G- q8 k7 s' s
0 v9 r" J" s5 Y tempstr = tempstr + c.Characters(j,
, S1 t! ?) x% ]5 _! H% }
% {$ o2 ]' s) z) v 1).Caption
$ H* {7 W: K0 a1 b( I& ?! P- G2 F6 e7 \2 M5 X+ S$ A
Else ( x& w' E6 u1 ]6 m3 \% e1 J6 {1 b7 C
8 B( k; @! G" g" L% g/ D$ _ Exit Do 5 p1 O5 v: B7 s* e, S
- X9 T; a& E9 L& d6 C/ o% h. @ End If
" j, b- m4 G, o3 w4 M) n6 t, j! A8 g# O: G5 u6 E7 w* M$ ]7 f' q
Loop
7 B0 n2 {; |6 R. |8 o9 ?3 m, o
- k k k* h- E# v4 F textStr = textStr + "{\L" +
0 z' c+ P% a. _& C- t6 p6 \2 w+ K3 Q$ T9 X
sonstr + cpt + tempstr + "\l}"
" V+ p* d' K* X/ z4 I9 p* @+ f6 p- B j: r. ], n) i) l
End If 2 N4 L4 O3 Y" o4 w* V: v! X+ j
Next j
0 R; X( Z b9 J, W
: v5 h: a, _/ S1 w% k$ p End If # y) S; @; @% ^7 l
! Z6 x# Y- f: ]# p. S# t2 n8 N! R
End Sub 7 A. l! `! p( E! [0 V
7 x7 D4 a. j' w$ R ‘下面函数控制字体本身属性 # ]8 ]; q/ I9 S$ d
3 @3 a W" u* U
Function ForeFontStr(m As Range, u As Integer) As String ( C% b/ \! e; {$ a/ w4 b
9 V5 J( w' n4 o+ G a1 = "\F" + m.Characters(u, 1).Font.Name + ";" ‘字体 $ j4 B. w; W- \- }+ b) Z# }7 y9 L8 Q
" N; V( l$ V/ b$ y# s5 i) [3 A
a2 = IIf(m.Characters(u, 1).Font.Superscript = $ b; ]: g7 e& B1 a
$ r. X9 x. n% C9 s( J
True, "\H0.33x;\A2;", "") '上脚标 2 u9 y# a- @. D" K K& H
# ?! ?2 L) z r0 Q$ f( _, h6 @ a3 = IIf(m.Characters(u, 1).Font.Subscript =
W. v' X Z& f3 S- u$ N( k
: T3 [% F. g6 ?8 M# L, l True, "\H0.33x;\A0;", "") '下脚标
: e$ m6 P+ ~+ R; H- }+ B Y4 X$ i7 S
a4 = IIf(m.Characters(u, 1).Font.FontStyle = 2 b$ U' `# t/ E( P* E2 j' f
+ R& f5 Y: N2 a( E "倾斜", "\Q18;", "") '倾斜
, h6 X1 e& [8 r, C4 J- L8 {7 ]3 t$ S
a5 = IIf(m.Characters(u, 1).Font.FontStyle =
9 ^) L# P7 S6 g8 ~( _7 s9 Y
5 @4 J \$ }: c: ^" E' T "加粗", "\W1.2;", "") '加粗
4 o5 L7 u+ l$ b, v9 e
- t8 i4 N) G- M2 Z7 U a6 = IIf(m.Characters(u, 1).Font.FontStyle = 0 `0 ]) d+ A0 ^1 q% ~
: \6 |" m/ e2 y6 h; }* z8 ?( e
"加粗 倾斜", "\W1.2;\Q18;", "") ' 加粗倾斜 % `7 C( T" ]4 N$ ]& d+ x9 @
. T/ c J1 V r ForeFontStr = a1 + a2 + a3 + a4 + a5 + a6
5 m; ]' z! c, a% G
. ^" m' `# Y- B+ ~8 X/ n# z End Function * U" s: m0 Z3 w5 k# K
3 o/ k3 t h2 `4 J
(2).表格中表格文字位置的转换
' `- _9 Q2 e. O' P; ^! Z( @
& z+ e* o6 z$ l" }' c 对文字对象的属性的直接控制来实现,通过with….end with 结构可以很容易地控制文字的高度、图层、颜色、书写方向。由于Mtext文字提供支持的排列位置分为9种,必须根据Microsoft Excel表格文字的排列方式加以合适的判定,然后进行转换。其具体的实现方法详见下面的程序。
' I- C$ g7 X) T/ `9 j
( \8 d Y& _$ Y$ w; D, l Sub kz( ) 1 a6 f+ p; Q6 H) q
' I; r9 u4 @3 t4 R With textObj ‘文字对象
0 q. X# B1 ^, I1 U! h
1 v7 g* n7 B# m. _ .Height = textHgt
, J9 d( `. Y6 K* F- g) u) ]
7 Z+ Q7 y! h5 ?5 p .Layer = newlayer.Name ‘设置图层
3 b4 D) ]9 T3 m) k' y6 T
, j3 V; f# N( y9 m( c* } .Color = acRed ‘设置颜色 9 ?! g8 {" B8 O3 ~ v
' L, ?' K) w) M+ V: @
.DrawingDirection = 1 ‘设置书写方向
" {9 g o4 _! |* x5 `# b7 f$ |4 y3 O8 }- K( T; v" |- W0 m( |
If (ma.VerticalAlignment = xlTop _
, K: E; `2 c9 A1 o, ^% P+ q4 e4 W. X8 `6 j4 Q4 M
Or ma.VerticalAlignment = xlGeneral) _
/ Z9 a S; o, ~
: P. d% G" v' \, X, c! V0 {0 P And (ma.HorizontalAlignment = xlLeft _ - R q; _5 a% M) Z3 p! M" D4 K
. k% ^$ z4 g7 t% z7 i
Or ma.HorizontalAlignment = xlGeneral) _
5 {+ z9 p4 v# H, l) p1 Q6 q H0 d7 M- q b( v
Then .AttachmentPoint = 1 'acAttachmentPointTopLeft " n2 ~ `0 f7 W3 D$ E
( d) Z0 D9 P# Y' X h& U
If (ma.VerticalAlignment = xlTop _
( B0 ]4 z$ S2 V H) g/ c |3 e# ~5 K r* M% |6 q' [
Or ma.VerticalAlignment = xlGeneral) _
' v2 h- K: U0 b8 b) Y& l. X4 I/ G: R& P
And (ma.HorizontalAlignment = xlCenter _
, Y$ _# g8 [8 b+ a; k- B% d
% \9 F1 ]' b' s, k# _% \% V ^ Or ma.HorizontalAlignment = xlJustify _
3 C+ B& q5 E, I) R* I
, T; ?. D, H: k Or ma.HorizontalAlignment = xlDistributed) _
" s/ l. b; }. h1 Q
* W! o/ J) a4 ? Then .AttachmentPoint = 2 'acAttachmentPointTopCenter
! U/ l, Y( o4 P1 E d. i% e
$ Q* g$ _% w2 J! v$ r \( p+ E If (ma.VerticalAlignment = xlTop _
]& c7 ~8 }! n) a/ T1 W9 X- [2 f8 v* k; l+ |; E+ P9 |
Or ma.VerticalAlignment = xlGeneral) _
0 O9 h. N$ d6 j. r- @7 KAnd ma.HorizontalAlignment = xlRight _ 2 a3 d' R7 D4 Y
: N, B. }7 n" J
Then .AttachmentPoint = 3 'acAttachmentPointTopRight
. M0 [3 t+ }; y, v. S+ r! C7 _6 u3 _( I/ P
If (ma.VerticalAlignment = xlCenter _
: M1 s4 K% v; P& q/ ~3 m: L
9 E% D" N4 I: j T9 [; ^* |. o( a Or ma.VerticalAlignment = xlJustify _
1 v* f; _ C$ X0 q! b. A' v& p0 K2 O+ n" f: Y; E
Or ma.VerticalAlignment = xlDistributed) _
. i7 Q+ r+ {. v" t! R
" ~4 O' R; b' A9 e3 i* J/ w And (ma.HorizontalAlignment = xlLeft _ 3 k! X9 b# x% w( a) J5 B
6 q# @+ i9 S) y, r c- g8 y! w Or ma.HorizontalAlignment = xlGeneral) _ % ~7 ` ]* Z" K# D% n2 N
% Q, q/ S7 z0 Z2 P Then .AttachmentPoint = 4 'acAttachmentPointMiddleLeft
% s8 p: c% g- ~! v
: }) k$ y; V( H2 ~7 Z. g' O2 c. c If (ma.VerticalAlignment = xlCenter _
! y7 N$ b, @' K! `! M" ?: |2 s0 P: l/ q4 ~1 d( r! a. C; P: w( B
Or ma.VerticalAlignment = xlJustify _ % C @* Z' }& E0 F
' ?- _: e {9 n Or ma.VerticalAlignment = xlDistributed) _
) {0 T6 i4 D! a; I) k: T( M* M3 \8 I8 D: w) O1 M& c
And (ma.HorizontalAlignment = xlCenter _ 0 U m7 g1 y- J/ b; K- _
% x. {6 ?+ g7 J Or ma.HorizontalAlignment = xlJustify _ / Q& c5 {# E. s5 H3 K
& @2 K: j+ L7 c* L) J9 n/ u Or ma.HorizontalAlignment = xlDistributed) _
5 d/ f' r, F0 p( G$ f
8 u* u6 p: n# k4 p/ H5 L1 { Then .AttachmentPoint = 5 'acAttachmentPointMiddleCenter
5 h# H% s+ ^+ F+ O; R4 o: F# }9 s0 S7 d$ u: e
If (ma.VerticalAlignment = xlCenter _ % t( b" J0 ?$ y0 P
7 f7 `0 b9 K2 b Or ma.VerticalAlignment = xlJustify _ : _# c) I9 Z+ y! I- i
% _6 \! a* j6 d$ _- D+ J% L Or ma.VerticalAlignment = xlDistributed) _ ( h5 C' L9 i9 z% q8 N% v
' ]; e# N6 s7 c6 R: `# _" ~7 u0 E- D, [
And ma.HorizontalAlignment = xlRight _ . L: |! p6 y; Z7 O' M* x% f* q
$ H2 Z4 d0 H' P( E
Then .AttachmentPoint = 6 'acAttachmentPointMiddleRight
, P* P& ?6 e) j" E F/ ?1 m9 B( ]% o2 D3 B6 y7 D
If ma.VerticalAlignment = xlBottom _
: O7 G$ V% v3 ?( Y/ Y& H' _3 h
& X1 I* K& _8 X) @5 _" ^& a And (ma.HorizontalAlignment = xlLeft _
0 K6 u2 J& d) N
. A/ z; u: h# Y9 T2 a7 P Or ma.HorizontalAlignment = xlGeneral) _ % T% q/ A2 y2 i% ?# h$ z* ?$ ]/ [# E
$ B& Q. W( H% E; _, J0 s
Then .AttachmentPoint = 7 'acAttachmentPointBottomLeft
, L! n% F# M0 v, q$ S! A% t6 l
7 \/ X2 G0 K* x1 T1 ]' J If ma.VerticalAlignment = xlBottom _ - P3 G3 l7 _' C3 {0 q" n2 x+ j# e
0 K# Q0 \& B( j: G! Y" b' j
And (ma.HorizontalAlignment = xlCenter _ ( Q6 `4 k$ }0 B: O# E2 Z2 N
& ?- o3 K3 m% Q' P" z5 |5 S, b Or ma.HorizontalAlignment = xlJustify _
9 p9 L: r1 ?- o7 E; j( a" d1 J: k( w, n+ \9 K
Or ma.HorizontalAlignment = xlDistributed) _
) V5 t4 |! T" x- E7 t, d) c! L8 g- t* o* d( B( T9 V
Then .AttachmentPoint = 8 'acAttachmentPointBottomCenter
/ @5 \1 S$ q8 s" D% ?$ T1 b1 P$ X
If ma.VerticalAlignment = xlBottom _
$ A+ Q5 P8 E" K) [, q K) V# F. V6 e0 Z3 P- {4 d3 w: |( a
And ma.HorizontalAlignment = xlRight _ + i+ R1 W' C; l
1 u% I% Q! x! n5 _! o, p1 Y+ s
Then .AttachmentPoint = 9 'acAttachmentPointBottomRight ! c& c" a% h1 p0 H
# Z' |+ ^2 W) C End With
- i/ o8 K5 p" D; V6 {2 C4 ^* ]. x1 t; n+ O( B v" K) p
textObj.Update
' Q5 Q6 ~( ^' ^+ `( ]3 B$ g. a! v% t9 }4 q; H6 e, P. S
End Sub |
|