Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Word OLE Formatting
Message
 
 
To
05/11/1998 15:09:24
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00154984
Message ID:
00155021
Views:
19
Paul
with goWord.Selection
   .Style = "Normal"
   .InsertAfter( "Project Name: " )
   this.moWordHelper.GotoBottom()
   .InsertAfter( alltrim( projects.cName ) )
   .Font.Underline = wdUnderlineSingle
   this.moWordHelper.GotoBottom()
   .InsertAfter( "    City: " )
   .Font.Underline = wdUnderlineNone
   this.moWordHelper.GotoBottom()
endwith

The moWordHelper object.GotoBottom method:
with this.moWord.Selection
   .MoveEnd( wdStory )         && move to end
   .Collapse( wdCollapseEnd )  && terminate selection
endwith
The Word constants are available in an article on my website. This was the first way I could get it to work. If you can find an easier way I'd appreciate hearing it.

>After inserting text at a bookmark, I would like to select that text and underline it in MSWord97.
>I have no problem starting Word, finding the correct bookmark and inserting the text using code like below:
>
>goWord=GETOBJECT(,"word.application")
>lcdocstr=SPACE(1)
>lcdocstr = "C:\my documents\newdoc.doc"
>goword.documents.open(lcdocstr)
>goword.activedocument.bookmarks("testmark").range.text= "Paul Montgomery"
>
>I am having the devils own time finding the right VBA command and sytax to select the inserted text and underline it.
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform