Wrox Programmer Forums
|
VB How-To Ask your "How do I do this with VB?" questions in this forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 27th, 2003, 02:06 AM
Registered User
 
Join Date: Dec 2003
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default vba and MS Word

using the code below I want to retain the formatting of the first insert of text to the table while applying a new format to the next inserted table. How can I change the current selection to only the second insert? The Text:= is supposed to make the new insert the current selection. Any help would be greatly appreciated.

With objWord.Selection.Tables(1)
   .Rows(3).Cells(1).Range.Text = "PLAINTIFF/PETITIONER: "
   .Rows(3).Cells(1).Range.Select
End With

With objWord.Selection
   .Font.Name = "Verdana"
   .Font.Size = 8.5
End With

objWord.Selection.InsertAfter Text:="John Smith"
With objWord.Selection
   .Font.Name = "Courier"
   .Font.Size = 12
End With





Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert Ms Access report to MS Word doc kite Access 1 October 22nd, 2007 01:45 AM
Re: Selecting a picture in MS Word VBA zainhansrod VB How-To 1 January 2nd, 2007 03:39 AM
VBA and MS Word Dolphin VB Components 1 February 25th, 2006 06:16 PM
VBA cannot create MS Word Object- ActiveX Error Dolphin Access VBA 0 February 7th, 2005 01:03 AM
Help with VBA (MS Word 2000) vb_programmer Beginning VB 6 0 May 22nd, 2004 12:26 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.