Discussion:
RANGE neu definieren
(zu alt für eine Antwort)
Andreas Peter
2010-10-04 08:55:46 UTC
Permalink
Hallo zusammen,

seit einigen Tagen plagt mich eine Anforderung, welche ich aktuell mit meinem sp?rlichen VBA-Wissen nicht l?sen kann. Ich schildere mal das Szenario:

Es gibt ein Manuskript, welches diverse Elemente hat: ?berschriften, Listen, Tabellen usw. Es gibt auch L?sungen zu Antworten. Diese L?sung liegt zwischen zwei Zeichen eingebettet. Da hei?t, ich muss die L?sung zwischen diesen beiden Zeichen extrahieren.

Es gibt jedoch auch ?berschriften, die ich auch ?berpr?fen muss, ob danach einen L?sung kommt.

F?r Tabellen verh?lt es sich ein wenig anders: Wenn ich in einer Tabelle eine L?sung gefunden haben, muss die gesamte Tabelle extrahiert werden.

Ich soll ein Script schreiben, welches mir ein neues Dokument ausgibt, wo die gesamten L?sungen mit ?berschriften und Tabellen aufgelistet sind. Dass schaffe ich noch :-)

Ein wenig habe ich schon gemacht :-)

sub test()

Dim doc As Document
Dim para As Paragraph
Dim rngSolution As Range
Dim temp As Range
Dim rngStart As String
Dim rngEnd As String
Dim findStart As String
Dim findEnd As String

Set doc = ActiveDocument

findStart = ChrW(9654)
findEnd = ChrW(9664)

For Each para In doc.Paragraphs
Set temp = para.Range
temp.Select
With temp.Find
.Text = findStart
While .Execute
temp.Start = temp.End
temp.End = temp.End - 1
Set rngSolution = doc.Range(Start:=temp.Start, End:=temp.End)
rngSolution.HighlightColorIndex = wdBrightGreen
Wend
End With
Next para

Meine aktuelle Herausforderung ist, dass ich nicht wei?, wie ich einen RANGE in einem Absatz mehrere Male setzen kann/neu definieren? Mit dem Code oben wird ab der ersten Fundstelle der gesamten Absatz markiert.

Ich hoffe, ich habe das Problem verst?ndlich beschrieben und jemand kann mir hier helfen. Ich w?re sehr dankbar.


Danke f?r das Lesen und eine eventuelle Antwort.
Andreas

Submitted via EggHeadCafe - Software Developer Portal of Choice
ASP.NET Caching Concepts
http://www.eggheadcafe.com/tutorials/aspnet/78de4d09-b013-48c0-8d4a-bedd68f675f5/aspnet-caching-concepts.aspx
fu hu
2010-10-04 13:07:42 UTC
Permalink
Want To Find Cheap shoes ?The Faithworthy Shoes From The Official Appointed Factory In China?Enjoy The Authentic Shoes With the Fake Price!Low to $55,Free Delivery In One Week And No Sale Tax!

www.findsoso.com

We offer a large rank of shoes. All of them are original level and cheap,either retail or wholesale is accept on findsoso.com,we can offer the lowest price with the Original shoes, if your order is up to 50PCS,the Price will be more favorable.We provid perfect after sale service,Delivery Free and No Sake Tax.Please trust to purchase!

www.findsoso.com


Submitted via EggHeadCafe - Software Developer Portal of Choice
MongoDb vs SQL Server Basic Speed Tests
http://www.eggheadcafe.com/tutorials/aspnet/6f573869-c8eb-40c3-9946-2f61e0163966/mongodb-vs-sql-server-basic-speed-tests.aspx
fu hu
2010-10-04 13:08:06 UTC
Permalink
Want To Find Cheap shoes ?The Faithworthy Shoes From The Official Appointed Factory In China?Enjoy The Authentic Shoes With the Fake Price!Low to $55,Free Delivery In One Week And No Sale Tax!

www.findsoso.com

We offer a large rank of shoes. All of them are original level and cheap,either retail or wholesale is accept on findsoso.com,we can offer the lowest price with the Original shoes, if your order is up to 50PCS,the Price will be more favorable.We provid perfect after sale service,Delivery Free and No Sake Tax.Please trust to purchase!

www.findsoso.com


Submitted via EggHeadCafe - Software Developer Portal of Choice
Using ASP.NET Session with Silverlight and WCF Services
http://www.eggheadcafe.com/tutorials/aspnet/c72cc77a-bf84-4180-a35b-46b8726ab782/using-aspnet-session-with-silverlight-and-wcf-services.aspx
Loading...