Solved

Convert to VB.NET

Posted on 2003-11-21
5
440 Views
Last Modified: 2008-03-17
I need to convert this vba code to vb.net. After the first line of the paragraph it is suppose to indent the following lines 5 clicks. It is working except that the entire paragraph is getting moved those 5 clicks. This code works inside a macro in MS Word......

Please help..........

With oDoc.Content.Application.Selection.ParagraphFormat
                .LeftIndent = oDoc.Content.Application.InchesToPoints(0.5)
                .RightIndent = oDoc.Content.Application.InchesToPoints(0)
                .SpaceBefore = 0
                .SpaceBeforeAuto = False
                .SpaceAfter = 0
                .SpaceAfterAuto = False
                .LineSpacingRule = oDoc.Content.Application.Selection.ParagraphFormat.LineSpacingRule.wdLineSpaceDouble
                .Alignment = CInt(Word.WdParagraphAlignment.wdAlignParagraphLeft)
                .WidowControl = True
                .KeepWithNext = False
                .KeepTogether = False
                .PageBreakBefore = False
                .NoLineNumber = False
                .Hyphenation = True
                .FirstLineIndent = oDoc.Content.Application.InchesToPoints(0.05)
                .OutlineLevel = 10 'oDoc.Content.Application.Selection.ParagraphFormat.OutlineLevel = 10 'CInt(Word.WdOutlineLevel.wdOutlineLevelBodyText = 0)
                .CharacterUnitLeftIndent = 0
                .CharacterUnitRightIndent = 0
                .CharacterUnitFirstLineIndent = 0
                .LineUnitBefore = 0
                .LineUnitAfter = 0
            End With
0
Comment
Question by:scorpion53061
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 96

Accepted Solution

by:
Bob Learned earned 500 total points
ID: 9799292
I read it that you need a hanging indent:

With oDoc.Content.Application.Selection.ParagraphFormat
        .LeftIndent = InchesToPoints(0.5)
        .FirstLineIndent = InchesToPoints(-0.5)
End With

This gives you a hanging indent of .5 inches.
0
 

Author Comment

by:scorpion53061
ID: 9799389
This will leave the rest of the paragrpah untouched????

If so you may have my first born...... :)
0
 

Author Comment

by:scorpion53061
ID: 9799434
Thank you very much..........

If you could point me to an internet resource or other source that helped you learn that stuff I will be greatful........
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 9799541
You know what I find to be most helpful with learning automation is to record actions using the Macro recorder in Word, and going from there.  I usually find that it records a lot more stuff than I need, but at least it is a place to start.  I think it would be difficult to find just the right web site for that all-encompassing source.  I have just culled my knowledge from many years of struggling and practicing and searching and struggling and succeeding and failing and struggling...Ya know!

I still don't find it very easy to automate Office after all these years!
0
 

Author Comment

by:scorpion53061
ID: 9810393
Hi,

Could I have your email address? I really would like to pick your brain about some things.

send to admin@jjkoepsell.com

IN addition, do you know how to automate that your page number would read for instance

"Martens 1"
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question