View Single Post
 
Old 08-13-2014, 06:42 AM
Tommes93 Tommes93 is offline Windows 7 64bit Office 2007
Novice
 
Join Date: Mar 2014
Posts: 9
Tommes93 is on a distinguished road
Default

alright.
so the code is not really necessary. i go from heading to heading and look what is unter the heading. if there is a table i go from wdCell to next wdCell and work with the cells.
Code:
For Each wdCell In ActiveDocument.Tables(ThisTableNumber).Range.Cells

Set Rng1 = wdCell.Range
Rng1.End = Rng1.End - 1
If Rng1.Font.Bold = True Then
        Set Rng2 = wdCell.Next.Range
        Rng2.End = Rng2.End - 1
        Select Case Rng1.Text
            Case "Name": TestcaseString = TestcaseString & "<name>" & Rng2 & "</name>" & vbCrLf
Now the problem is:
if the Rng2 looks like: "Hello, This is Tom. Im 21 yrs old." the whole formatting gets lost.
my xml file needs this formatting. a bold word needs to look like "<strong>word</strong>" in the xml file.
and this is where i need some help or ideas.
Reply With Quote