Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Update word bookmarks change alignment
Message
 
To
19/07/2009 07:22:28
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Application:
Desktop
Miscellaneous
Thread ID:
01413243
Message ID:
01413382
Views:
36
>Hi
>Help please,
>
>I have word documents - few paragraph with different alignments.
>
>I want to update some bookmarks and vfp change the alignment as following:
>oword = createobject("word.application")
>with oword
>	.visible=.t.
>	oword.documents.open( "c:\wt\aa.doc") 
>	oword.activedocument.saveas("newdoc")
>	oword.activedocument.bookmarks("mydocdate").select
>	.selection.text=dtoc(date()+25)&&Opss..........code change the alignment frrom left to right
>	oword.activedocument.bookmarks("mtxtsum").select
>	.selection.text="My new text5"
>endwith
I believe that the behavior depends on the exact text in the bookmark. You may not see it, but the text can include invisible pieces like spaces tabs, etc, and then with replacing the text they all gone. Thus the text appearance changes.
If you wish, send to me your file to investigate.

Good Luck
Previous
Reply
Map
View

Click here to load this message in the networking platform