Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / January 2006

Tip: Looking for answers? Try searching our database.

Delete leading spaces

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Budget Programmer - 04 Jan 2006 23:44 GMT
Hello,
I have a 3 column table that is produced for me (I have no control over this
part).  THe problem is that it produces leading blanks (1 or 2) in column 1.  
I can select various cells within the table, but I can't figure out how to
ensure that I'm always starting on the left, and that I'm eliminating leading
spaces.
Many Thanks.
Signature

Programmer on Budget

Jean-Guy Marcil - 05 Jan 2006 00:29 GMT
Budget Programmer was telling us:
Budget Programmer nous racontait que :

> Hello,
> I have a 3 column table that is produced for me (I have no control
[quoted text clipped - 3 lines]
> and that I'm eliminating leading spaces.
> Many Thanks.

A fast way to eliminate leading spaces is to select the column, set the
alignment to Center, then back to what it was before. (If it is already set
to Center, set to Left, then back to Center)

Signature

Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org 

Budget Programmer - 05 Jan 2006 02:02 GMT
Cela fonctionne bien.  Merci.
Signature

Programmer on Budget

> Budget Programmer was telling us:
> Budget Programmer nous racontait que :
[quoted text clipped - 10 lines]
> alignment to Center, then back to what it was before. (If it is already set
> to Center, set to Left, then back to Center)
Budget Programmer - 05 Jan 2006 14:55 GMT
Jean-Guy,
Thiw worked when I did it "manually" in word.  But I can't get it to work in
a Macro.  I'm using the method:

'       Select the column
       Selection.Columns(lngCurrentColumn).Select
'       Center Justify
       Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter
'       Left Justify (this should delete leading blanks)
       Selection.ParagraphFormat.Alignment = wdAlignParagraphLeft

It executes OK.  When I step through the code, I can see the column center
justified, but when the next step is executed, it keeps the original leading
space.  Again, it works great when I do it "manually" in the word client.

Thanks for your help.

Signature

Programmer on Budget

> Budget Programmer was telling us:
> Budget Programmer nous racontait que :
[quoted text clipped - 10 lines]
> alignment to Center, then back to what it was before. (If it is already set
> to Center, set to Left, then back to Center)
Jean-Guy Marcil - 05 Jan 2006 20:54 GMT
Budget Programmer was telling us:
Budget Programmer nous racontait que :

> Jean-Guy,
> Thiw worked when I did it "manually" in word.  But I can't get it to
[quoted text clipped - 11 lines]
> original leading space.  Again, it works great when I do it
> "manually" in the word client.

Ah, right, in this case, try this (Note that you have to select the text
first)

   Application.CommandBars("Formatting").Controls("Center").Execute
   Selection.ParagraphFormat.Alignment = wdAlignParagraphLeft

Signature

Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org 


Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.