We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Equivalent of move- goto- endkey and so on

Hello.

I am trying to figure out how to do the following in a Aspose.words document:

Dim objWord As New Microsoft.Office.Interop.Word.Application

objWord.Selection.GoTo(What:=-1, Name:="Ch2")

objWord.Selection.HomeKey(Unit:=5)

objWord.Selection.MoveDown(Unit:=5, Count:=1)

objWord.Selection.EndKey(Unit:=5, Extend:=1)

objWord.Selection.MoveLeft(Unit:=1, Count:=1, Extend:=1)

arrChapter(0) = Replace(objWord.Selection.Text, vbTab, " ")

chapter2PageNumber = objWord.Selection.Information(3)

Is this possible?






Hi Jørn,

Thanks for your inquiry. Please note that Aspose.Words is quite
different from the Microsoft Word’s Object Model in that it represents
the document as a tree of objects more like an XML DOM tree. If
you worked with any XML DOM library you will find it is easy to
understand and work with Aspose.Words. When you load a Word document
into Aspose.Words, it builds its DOM and all document elements and
formatting are simply loaded into memory. Please read the following
articles for more information on DOM:

http://www.aspose.com/docs/display/wordsnet/Object+Model+Overview
http://www.aspose.com/docs/display/wordsnet/Composition+Diagrams

I suggest you please read about DocumentBuilder and moving cursor in the document from here:
http://www.aspose.com/docs/display/wordsnet/DocumentBuilder+Overview
http://www.aspose.com/docs/display/wordsnet/Moving+the+Cursor

Hope this helps you. Please let us know if you have any more queries.

Hi.

Thank you for the answer.

I tried opening a document with 6 bookmarks, but I can only find the first bookmark. What can be wrong?

Code:

Dim inputDoc As New Aspose.Words.Document(path)

inputDoc.Range.Bookmarks <- This only contain the first bookmark. I can guarantee that there is six bookmarks in the file.

Hi Jørn,

Thanks for your inquiry. Perhaps, you are using Aspose.Words without license. Please note that in evaluation mode there
are some limitations applied. E.g A
spose.Words injects an evaluation watermark at the top of the document. The document’s content are truncated after a certain number of paragraphs during import or export.


Please request for temporary license from here:
http://www.aspose.com/corporate/purchase/temporary-license.aspx

Please read the following documentation link about applying license.
http://www.aspose.com/docs/display/wordsnet/Applying+a+License

If you still face problem, please share your input Word document and code here for testing purposes. I will investigate the issue on my side and provide you more information.