|
继续
End If ' W$ E* W4 d) L c$ M( D. g
* H- W3 w! z& O6 I! c
If y = 1 Then
. }( W. ~; R1 K' B3 \. j" C4 o4 R$ m+ Z2 V1 S/ O
If ma.Borders(xlEdgeLeft).LineStyle
. J" D% Y+ T6 x. u! v
: z7 n& `9 [' N' \( I" u < > xlNone Then
% b) C; M8 i# w$ d
/ ^/ M9 h/ B! l/ K ptArray(0) = xpoint
% S6 o/ e# F# [' \7 r$ M- H5 e [
‘第四点坐标(数组下标 0 and 1) 4 V* f. N. r1 @! _2 U. y! @; i o
' E6 c+ A7 B9 T% [/ m
ptArray(1) = ypoint - yh 2 c+ t N' p( F5 h* V7 Q
6 O s# y+ T* J/ {. C3 j7 v ptArray(2) = xpoint / T# R+ g+ G$ c5 c$ J, i* O
/ l% g" V6 E8 [3 E9 A; G1 G' s ‘第一点坐标(数组下标 2 and 3)
( t7 W: b7 ?! @% P2 R' N5 D! k$ d1 h& _ N1 ~9 z' J5 V$ d
ptArray(3) = ypoint
: V# f. i! }3 c1 j; w5 w0 j) c9 O, E. t6 Q
End If + K' p) g& V8 q, c( R
2 Z$ ~- v/ T& |
Lineweight lwployobj, ma.Borders(xlEdgeLeft).Weight p& w# ?/ F u4 K. T
4 ~- `- o0 I1 Q8 e4 [4 p% [ End If ; G* ~* @! h4 ^" A7 {9 [
) M1 L5 x; d9 S9 b
If ma.Borders(xlEdgeRight).LineStyle
c. `: {2 H8 W1 T3 C. Q
5 [; ]2 e& \( h < > xlNone Then
6 w; a. n+ @3 @4 _. v3 k( c
: R* ?0 f* v4 l/ W" _* f5 V ptArray(0) = xpoint + xh
, ]. J4 j- d! O6 F. G1 u/ w G9 C0 I h F( O
‘第二点坐标(数组下标 0 and 1) $ J% D, |% _ H/ l
* @' f: @$ K: G: G
ptArray(1) = ypoint
$ f! G# v# l1 w) _6 A, r2 c/ ]3 s( |, |" f
ptArray(2) = xpoint + xh
5 u% l4 e" v: c2 ~/ {
# C7 E8 X, Z9 q- G' n ‘第三点坐标(数组下标 2 and 3) ) G& X. A( E( C6 N/ K7 _
+ t& s; _) t' {; L
ptArray(3) = ypoint – yh , a3 n5 |7 y4 C* X* J8 L9 \) r6 m
' H, ~/ j, }: e) o( x. o Lineweight lwployobj,
- r0 b# e6 C$ ]& L6 t E8 N3 h4 P0 e
ma.Borders(xlEdgeRight).Weight 1 g1 b/ p, D' Q2 ~) z8 m
+ z- l4 {: s6 p* d6 o0 m2 N9 h End If
0 m+ K. @( y2 |
& E7 _" e$ P z4 d @4 Y/ i: h Set lwployobj = moSpace.AddLightWeightPolyline(ptArray)
, Z8 H6 t# U a f+ e6 P8 X
7 P u4 z- i& L1 o& U8 O' [4 P4 Y& } ‘在AutoCAD文件里画线 * _: w6 k: Q& |0 h. m
8 ~9 @, e9 S, x( U( t* l' o
With lwployobj * ?" a5 U, z5 B1 _% F9 S8 l, A
) M0 ?: b0 p: o .Layer = newlayer.name ‘指定lwployobj所在图层
5 {) K! U% R" h9 q3 v% z Z; D( K9 O
8 [! Z' x6 ~* \, g! r' a .Color = acBlue ‘指定lwployobj的颜色
$ a# S4 r! t$ D1 B5 F/ K" _* ~* E$ B1 _8 j5 C
End With
3 l2 p! u3 b R8 c! t0 P3 ?. j2 q/ p; z$ y
Lwployobj.Update
/ o2 n: v8 e. t( i
6 C, x0 R2 l! R; b Next y
) W) r# a" m7 f9 k5 E/ `$ g, S
" X- f) n$ Z# w4 M I* L( e; y2 K9 t Next x # H0 ~5 ]5 S+ l" ]( i
- \$ L7 E* D3 s7 f4 @
End Sub
; D: b: ^: v' T4 x3 H
6 X7 e7 C( c6 ^5 k ‘下面程序控制线条粗细 & _- E& W i! F, \/ z6 H5 \
9 U5 M4 c S& Y/ i4 Y; L Sub Lineweight(ByVal line As Object, u As Integer) 6 C2 F% ~9 t: m' ?8 w
K$ s3 E$ N& }/ Q3 v Select Case u
8 ~* @# [! H: G3 p" S+ `; x6 @$ D" @& J; C1 E" x3 y9 C
Case 1
6 A3 a X/ G+ }* R* o4 p9 o; j6 r& _, R
Call line.SetWidth(0, 0.1, 0.1) 4 |0 H6 C6 T1 N
8 `) [( m+ E( U7 K8 D6 F Case 2
R" p* ~1 f4 [; }! v
# d# m2 x, a# {% V- ? Call line.SetWidth(0, 0.3, 0.3)
8 X/ z p4 `9 T5 m0 r0 X6 l0 I: }% ?5 Y5 o+ Y- N" u1 E
Case -4138
1 V0 ~5 } ^$ Y. l2 O
# y) _3 t* b. X* [7 S$ S Call line.SetWidth(0, 0.5, 0.5)
/ e2 a' f8 W3 t. j' T5 Q. D& @" q0 r9 L6 ^
Case 4
& \7 q- `8 O: A( o) g o1 X3 p% B8 B1 P
Call line.SetWidth(0, 1, 1)
' y) i" m" {8 {+ L& F7 F8 F, _' c. h1 b+ x- S
Case Else
- a6 Q0 B3 z% A7 {- c3 N& h" O5 a( d# I8 V T9 a- f$ a6 U+ }
Call line.SetWidth(0, 0.1, 0.1) ( }# r2 L- _" N3 E$ f8 _
- u+ h: W8 X2 g9 F" G End Select
2 r" ]# i4 G& U" V( d
8 r" `" o" @# Q9 Z& l r5 Y End Sub % \0 ?$ s5 }, f) U5 ^/ G
& M7 J0 C1 ]% H" S% w ‘下面程序完成列号转换 $ |' K5 k) |4 y5 Q& B2 w7 z n9 D# ^
8 q" T, R* @- L+ p5 u
Function zh(pp As Integer) As String , d6 f' x. ^1 N$ s' M: K% H
7 r1 f8 [! W# P. }
If pp < 26 Then
2 p' D: K1 z7 x2 c& Y3 l( \
& O, p4 C! U& X: A4 D8 L zh = Chr(64 + pp)
- r! B! Z# x' y; j- m& L, |, Q1 B% N# `% C1 O& b0 s& ?2 ~
Else m5 \" O2 q. m( P. I2 @5 T$ e
, R6 U; n4 j1 b0 G8 _ zh = Chr(64 + Int(pp / 26)) + Chr(64 + pp Mod 26)
. q- ]; `4 [1 K+ p
: B2 f' u+ R5 s% n End If [8 x9 [ ~9 W1 Y$ N2 Y# `# Y
$ S3 m- A! n2 u9 ~" }
End Function + u" S# X$ W9 z X" L
% i( G; R+ ]" X& \0 y 3、表格文字转换 1 B; a" p! I9 u% n- h1 n7 d
* y. y& _9 c6 d' a, Z. r7 }. n
表格文字转换包括表格文字本身转换和表格文字在表格中位置的转换两个部分。 - K4 c- S- z. a5 R3 g. y
1 A! O- r( i2 i- t/ [6 ] 在AutoCAD中,文字标注的形式有多种,与Microsoft Excel 单元格区域多行文本内容相对应的是多行文本命令。AutoCAD提供的VBA添加多行文本的命令语句是:
: f2 y9 x+ W6 b: rRetVal = object.AddMText(InsertionPoint, Width, Text) V" X1 D8 h# }. ?! V3 z* q; [
: ^: k: e& V$ g6 e" m0 m 通过修改RetVal的属性可以控制表格文字在表格中的位置。 / W: F# C9 a0 K" n' E& ?
) B2 [$ I v( _- j8 Z% i1 Y+ _ (1).表格文字本身的转换 / U1 g" q! O$ B2 |9 M
- e. v: P6 P7 d# ]) x& `- f+ R
分析AddMText命令可以得出:表格文字所在位置、文字内容宽度,文字内容,均可通过此命令来添加。然而表格文字字体,大小,下划线、上下脚标,倾斜,加粗等却不能。一般的方法是采用修改字体形文件的方法来实现,方法烦琐,不便于实现,而且仅对修改过形文件的字体有效。况且当同一文字块内的不同文字的字体,大小,下划线、上下脚标,倾斜,加粗不同时,使用修改字体形文件的方法也无法实现。本文介绍一种直接利用Mtext命令提供的方法进行转换。
* l$ H8 f; T+ |- I. Y+ z- D5 G" Q/ d& s- c* g/ H% o
在AddMText命令中,影响文字内容和文字属性的参数Text。在具体文字前加上一定的控制符号可以控制文字的文字属性,具体控制符号可以参阅AutoCAD帮助文件。例如,{\F宋体;\Q18;\W1.2;ABCDEFG}把“ABCDEFG”设置成宋体、向右倾斜18度,每个字的宽度是正常宽度1.2倍。 ' d# o. |+ V; b
! z* S- m1 X; K! s/ h0 a 本程序具体采用的方法是:读取Microsoft Excel文件某一单元格区域里的某第j个字符属性(字体,大小,下划线、上、下脚标,倾斜,加粗),读取Microsoft Excel文件某一单元格区域里的某第j+1个字符属性,如果与第j个字符相同,则二者采用同样的控制符号;若不同,则从第j+1个字符开始,重复前面的工作。
7 x8 p0 B1 r8 k d) ]/ F1 c8 Z6 P: u3 G; V3 O9 a6 ~3 o; e
Sub wz ( ) " m4 W+ ~6 p0 g8 X; q0 [7 C
6 V4 c2 j: ]6 v* c: d* C# i Char = RTrim(Left(c.Characters.Caption, 256))
4 s% t# {0 x5 w4 D# n
, B% n- B2 X" c, E+ U5 k6 ` If Char < > Empty Then
4 J, w2 k2 u$ G1 ]6 @- n/ g/ {6 C J
textStr = "" / I. {( g+ Y% s( s' U% i: X
8 Y8 S* `" q* r- C% G For j = 1 To Len(Char) ) g( z$ O# {/ G( q
1 |4 k7 E# C( K. `9 U
If c.Characters(j, 1).Font.Underline = " h. p3 [0 o3 x9 V
3 S- t3 P) l9 f. \8 }) {5 N# H" |4 ` xlUnderlineStyleNone Then 8 I6 t1 q1 O1 J1 c! r5 [. d4 ?, b
! [5 C, o* S" M1 D; s! x3 r cpt = c.Characters(j, 1).Caption
- }- j3 X" P$ {- d* R2 s7 O6 g7 b' t3 f3 b3 z4 T
sonstr = ForeFontStr(c, j)
E) o$ K+ l5 k7 h9 d. m4 V7 D$ d5 C6 N! |! s3 R: H7 h
tempstr = "" 0 E( G( e' j' g# B, W" s4 a4 ~% h
' X% N+ w2 z2 S, l0 A
Do While j + 1 < = Len(Char) . c* b9 ?# ~ f7 `
8 N3 n) y% W: b n
sonstr1 = ForeFontStr(c, j + 1) 2 ~7 e0 z* J, b) f/ H
( ]- h2 M, x- T; A' ^
If sonstr1 = sonstr Then
" S! b J: u4 C* u1 E; e. T" \* l4 E$ |3 B- o
j = j + 1 ' @$ x3 z; V8 B" @6 B$ ]- x
0 n% C" ?- h2 b; s. s# X% ~8 I
tempstr = tempstr + c.Characters(j, , c" v+ o, y0 h0 K( u" ]0 }
& R* e z$ K5 x4 `) G8 s: E 1).Caption
- V: X! Y/ x& b* Q
0 H3 P. {: _3 s5 G) T* a Else
^* v8 r$ v" f4 m$ H( g! A
, p7 }- P! Z% ~ K& ~ Exit Do 4 ]- X4 K; |1 _# P) ^/ R* |
& t3 a, s* T$ u1 w End If # `' B+ a; V0 e: `
, I" ^% x1 h1 e6 l Loop ) L! u" {- y d& c m% q& q
" e: i8 [! E7 U) Q1 O
textStr = textStr + "{" + sonstr + cpt
( A$ O3 k% q' p' u! H* k
# y/ `2 t9 \! s/ Z7 c + tempstr + "}"
; v' T/ l4 ~8 Q$ ]
0 y6 b, u! x" \; R. N Else / f9 \- w* z# I2 v
- x3 h" ~* Q9 m9 @5 V cpt = c.Characters(j, 1).Caption
4 o8 G% E0 p5 b% Y5 T L C
* L7 {4 p6 C9 o( m. l; T sonstr = ForeFontStr(c, j) ! J0 d' C) F, Z/ s% v3 f/ a
3 _# G) \9 \) D$ F# U4 i1 X! D' [# ~$ } tempstr = "" # ] R& R W* r u8 v3 ]5 Y F+ T
$ N8 v# Y9 M/ O+ b Do While j + 1 < = Len(Char)
0 \: o& k2 a/ H8 n% R u+ o; g
, o3 I3 X2 y1 [; Y T% R- J6 a, o sonstr1 = ForeFontStr(c, j + 1) ' L: ^: s8 X3 Z3 t4 p3 f
9 H* L* l+ [! E* m' s3 x e8 Y If sonstr1 = sonstr Then
7 k# y1 G' p' Y! J& K& |. y" n1 O6 ]7 \" u. T. Q" _' x5 O8 s
j = j + 1 " l" s- a* N, v
) j3 Q, ` n! u* @( l" j3 Y
tempstr = tempstr + c.Characters(j,
# S }" ~9 X7 t) k8 O+ S! N
- y1 S4 y* s$ v8 V( Z 1).Caption 3 c# ]" D2 l! U/ | R+ `0 _; w
9 k9 i. J' Z2 y G Else 7 o. f* c! I8 k9 s
. ]. T4 }0 ~6 S7 b
Exit Do + `) W+ K( t0 u6 T: m, q& b8 ~! o1 x
L6 ~3 f n; o End If u0 O4 a# W) t: ]
; J, X1 ^& v# a, Y$ p
Loop ( ?4 o# b. ]7 z7 E
. i2 _7 C) ~8 J2 B; H5 V9 b textStr = textStr + "{\L" +
4 ~" p; I. S8 g& _5 P6 _! e
4 A8 n5 n& U: q2 K5 x) y; e$ y, ? sonstr + cpt + tempstr + "\l}"
; q$ Q8 Y5 X4 R; J+ ~
- g$ Q- o9 C2 H9 w4 r, O/ Z. Y End If
+ P* u" K% v! j1 Q9 S4 TNext j 9 t. X' G% d0 p& P6 p
1 y3 D1 Y4 ]& Z8 t3 n6 h0 | End If
8 q, D" `5 L) x
6 P4 A0 z4 K1 b4 u$ n End Sub
4 F' C: m, E- K
0 @5 t( ~0 |$ k7 x; P ‘下面函数控制字体本身属性
/ O& j9 J! R, R9 p5 Y( `( ] F4 K" a3 L) ]0 f% Z
Function ForeFontStr(m As Range, u As Integer) As String
4 q9 }3 i& g. b, r) a, f2 ~- e8 E" P- v3 b' S9 w
a1 = "\F" + m.Characters(u, 1).Font.Name + ";" ‘字体 * K' ^% u/ y- [. S
. I. l W4 I5 H: w) y- {8 Z: M a2 = IIf(m.Characters(u, 1).Font.Superscript = % n$ h' W% \; \2 R
1 h2 h3 S8 ^9 P4 S7 F
True, "\H0.33x;\A2;", "") '上脚标 / O8 |! o. j' i! J
! y% ^; p) `2 y) |( w/ C a3 = IIf(m.Characters(u, 1).Font.Subscript = ! {7 h0 U _. C0 `4 o
! g- k; b M& Z1 Z' ^ True, "\H0.33x;\A0;", "") '下脚标
3 _/ D* n% _2 C( E
5 u; G( L" _+ r9 o8 p a4 = IIf(m.Characters(u, 1).Font.FontStyle =
. E9 T# [4 c ^% n3 F) { \/ O; u
* h- o4 y/ G' O* x! \ "倾斜", "\Q18;", "") '倾斜 ) ?1 M5 r) @' x! \
. l5 L) _/ ?6 J a5 = IIf(m.Characters(u, 1).Font.FontStyle = & [2 T! J4 E) n7 p/ a
* }& W# P% S; {. r' a) M8 }
"加粗", "\W1.2;", "") '加粗 / D" X/ @9 C0 J4 }. B l
% W' a/ j+ H9 `0 G3 V5 g/ N# Z9 n* n
a6 = IIf(m.Characters(u, 1).Font.FontStyle =
5 J, x% f# e# Y: Z9 A+ y- F% f* L/ v% c
"加粗 倾斜", "\W1.2;\Q18;", "") ' 加粗倾斜 & R& {1 g6 Q8 h& s k: v
/ t2 B. Y8 A& y U7 }
ForeFontStr = a1 + a2 + a3 + a4 + a5 + a6 3 ]3 a: O6 Y) l
5 `: T+ Y# l8 k5 M$ L, j1 A7 k
End Function
3 Z& B6 [! D& v6 @' M0 S3 U, v% O5 B0 C0 i! {
(2).表格中表格文字位置的转换 , b5 K- H4 a" \) n _
5 P, h. `6 O& @2 X2 s. m& B 对文字对象的属性的直接控制来实现,通过with….end with 结构可以很容易地控制文字的高度、图层、颜色、书写方向。由于Mtext文字提供支持的排列位置分为9种,必须根据Microsoft Excel表格文字的排列方式加以合适的判定,然后进行转换。其具体的实现方法详见下面的程序。 q: r) g3 x O* c/ O4 i
: E# i# N4 n/ T$ M% S
Sub kz( ) * X6 M6 u% @$ s
- h2 r7 B, X8 I/ f0 W# [
With textObj ‘文字对象
8 B- S% Q8 h5 f" i, ]2 P5 ?% u* u5 [1 q. g* |, p. C
.Height = textHgt
) J; \& `2 k* J9 S0 E
( K8 s1 ?) F% q, F5 ^5 M( S- B .Layer = newlayer.Name ‘设置图层 % q. g" G. {3 E5 C1 I
% l+ P9 a* K" d% [0 ^ .Color = acRed ‘设置颜色 & b* F v$ T: t. g9 \: x! J3 D
5 G2 K/ W, ?; S) y i# H. q
.DrawingDirection = 1 ‘设置书写方向 6 e& I- P$ e: G2 J, g5 S
/ I- O; K* ]: C& ^; Y% [
If (ma.VerticalAlignment = xlTop _ # c3 K8 e# w+ B) q* I
2 }0 R/ h7 t! e: G' M/ q% M" G" f
Or ma.VerticalAlignment = xlGeneral) _ 6 Z# X3 _: R; A! f
2 X% _3 ]6 a( t: I2 l$ h
And (ma.HorizontalAlignment = xlLeft _ 4 m5 v5 E; T+ g5 m
! [; `! W- H' n# Q
Or ma.HorizontalAlignment = xlGeneral) _
7 L1 c7 f+ e. L( L9 e+ C( q' w- m) D! x, n; n, L' p' j8 c4 b1 L8 e
Then .AttachmentPoint = 1 'acAttachmentPointTopLeft
( O/ |6 `- k8 c' z! J& l* g3 a0 o( e2 R& @
If (ma.VerticalAlignment = xlTop _ 1 n }' C! z8 c/ v1 _! a
4 s% \! @2 b& d) A+ a% B3 o/ T8 q
Or ma.VerticalAlignment = xlGeneral) _
7 n9 L1 W0 f+ C- F0 D [8 F2 t6 w+ k& l4 e
And (ma.HorizontalAlignment = xlCenter _
; j) y! V# V& U0 }+ M8 v' k' I
2 x$ o. ?8 n$ N D Or ma.HorizontalAlignment = xlJustify _
9 L i; W0 Q2 J Y6 M" B
) g1 c# s: f7 X, O2 }* Y Or ma.HorizontalAlignment = xlDistributed) _ 6 s0 R. h* A. q( _4 G
/ _( `/ ~" v% Y) ^, x; H9 N! ~ Then .AttachmentPoint = 2 'acAttachmentPointTopCenter
9 @6 H! s7 J, H M' {
/ Q+ ~ x/ y1 `, m If (ma.VerticalAlignment = xlTop _
0 K" d, G$ M$ k# O2 w0 k) b$ z' S& g# k- W; C; O
Or ma.VerticalAlignment = xlGeneral) _
7 q1 H/ C- k V; Z, s' hAnd ma.HorizontalAlignment = xlRight _
5 u8 A/ B8 F4 P- V! k4 {* }# x$ Y- @+ @! Y6 Z+ \
Then .AttachmentPoint = 3 'acAttachmentPointTopRight $ j s1 N+ F1 I3 ~' v9 i
B/ |- d9 B, [( w8 h; U( ?- @ If (ma.VerticalAlignment = xlCenter _ ' G# W9 l' @! [0 R
/ x& H; o, z5 m, w/ L g8 \ Or ma.VerticalAlignment = xlJustify _
\; u: h+ }* L, W# t( c( @% U) ~) g l) S/ |2 I: g; B3 R( C
Or ma.VerticalAlignment = xlDistributed) _
" i( V, R6 ]6 ]8 w7 U- W* G1 _7 j- |7 W
And (ma.HorizontalAlignment = xlLeft _ 9 m0 U; Y0 |6 s- Y0 j u- Q, [. X
" j* d8 j7 s% W7 N0 Q! P6 K& k3 M
Or ma.HorizontalAlignment = xlGeneral) _ # r D. _) Q3 E0 Z0 ]
% ]2 `0 L1 |! |2 q Then .AttachmentPoint = 4 'acAttachmentPointMiddleLeft
7 y: c% \2 T& G) M4 R$ A& `9 u
* s, T% R1 u% ?: [# B& T1 A If (ma.VerticalAlignment = xlCenter _ , V2 s" i+ C# z" u1 _
5 [1 R: x, L( m. h% R Or ma.VerticalAlignment = xlJustify _ % ]6 F! @6 K8 q! K' V
$ v# u: t1 g4 g v, m Or ma.VerticalAlignment = xlDistributed) _ * L0 A7 g6 J. D1 C- |( `1 f9 V8 ]
$ y# u# d7 u- Q2 @2 H2 A- @* P And (ma.HorizontalAlignment = xlCenter _
g' B) V2 C ]: b2 o' o4 u) d% H; w: I, ], T: x
Or ma.HorizontalAlignment = xlJustify _ * B0 E* r: s+ S4 W1 u( m3 I
8 B. V2 n% N3 ~ Or ma.HorizontalAlignment = xlDistributed) _ * Q# _# O0 Y7 r) J
. M j( B$ H+ i5 s Then .AttachmentPoint = 5 'acAttachmentPointMiddleCenter 9 n" R7 S( c+ l3 t! w' E
1 Y$ J+ A/ v* E1 b0 m3 j! m
If (ma.VerticalAlignment = xlCenter _ * n7 N! }0 D( j1 n! i/ W
# h6 ?( F! a: ?' A
Or ma.VerticalAlignment = xlJustify _
8 D% E1 r5 r/ U5 z8 Y3 K5 S
) @& j; D, J' u Or ma.VerticalAlignment = xlDistributed) _ P# Q7 x# |% j: f4 N) t- b
. q( {+ r7 S+ o) @2 N And ma.HorizontalAlignment = xlRight _
$ z+ Z5 @; Q' F+ f- }7 I) b: J7 ]9 {3 y; l& P: D% B
Then .AttachmentPoint = 6 'acAttachmentPointMiddleRight / T0 p: m, T2 }
" Q; O4 D' g- g, K6 V' M ] If ma.VerticalAlignment = xlBottom _
: U* k# _. g! r, L# u5 Y- ]8 s# ^. S
And (ma.HorizontalAlignment = xlLeft _
. k% c/ r6 D7 C0 b; Y7 r
d$ k) `0 d1 x Or ma.HorizontalAlignment = xlGeneral) _ 8 }4 r: \: O9 I( B* m. u
! C" k2 t5 J2 z Then .AttachmentPoint = 7 'acAttachmentPointBottomLeft 4 S% a0 b. k6 l
. o1 o4 Y. }) H8 N' v
If ma.VerticalAlignment = xlBottom _ 4 }6 ~2 Y# D+ [# E7 B
6 F4 @( v" m/ F- @% V4 N0 t; L* h
And (ma.HorizontalAlignment = xlCenter _
$ M$ Q- X# F7 [4 g+ n: T
1 J8 v5 g7 R6 b7 \& g Or ma.HorizontalAlignment = xlJustify _
) ], `% a) f1 `+ z; _. L3 J* j: S; F6 P4 G, A8 a8 ?+ K" d) Z
Or ma.HorizontalAlignment = xlDistributed) _
% w0 j' o# C# L) H% [6 F
8 O! W, k* S) m7 N% c Then .AttachmentPoint = 8 'acAttachmentPointBottomCenter
( _% p6 \7 N# @9 g: U0 g) L C- I$ ?+ n/ c
If ma.VerticalAlignment = xlBottom _ / C* D x9 [2 l
7 G6 c2 R# v5 l* H
And ma.HorizontalAlignment = xlRight _ / m7 F: L6 m: _0 C3 t. G& B
+ s% L, c4 a! i5 C' K& V9 _9 \
Then .AttachmentPoint = 9 'acAttachmentPointBottomRight
/ M+ W$ S, J! R/ u( [9 H+ j5 i( Z7 l8 M$ v. B; T
End With 7 v2 O) E3 ?6 G; T
- ~6 e7 Y+ L5 N+ _4 V1 _! Z textObj.Update
4 U5 r( Z t; b
7 P/ N2 C/ C* Z! o End Sub |
|