KAMACI


How can i get my ActiveDocument's content




Re: Getting The Conten Of A Word Document?


Re: Getting The Conten Of A Word Document?

Mohan Kumar Karunakaran

Can you tell me what exactly you want to do with this content

Try this.

Dim rng as range

Set rng = activedocument.range

rng.font.name = "Arial"

Regards,

Mohan







Re: Getting The Conten Of A Word Document?

KAMACI

I want to get the content of the world document and want to write them into a new Text file.(i mean that i want to transform Myword.doc to Myword.txt)





Re: Getting The Conten Of A Word Document?

KAMACI

In fact i am new to .Net and i don't really now the differences between using visual studio tools for office and vba.I am trying to make an Add-in with Visual Basic but i couldn' handle that problem.





Re: Getting The Conten Of A Word Document?

KAMACI

a = Documents("MyDoc1").Content

When i do this the compiler says that; the namespace 'Documents' is not declared.How can i recognize it to my visual studio





Re: Getting The Conten Of A Word Document?

bi-lya

http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=2121660&SiteID=1

it's for Excel.

Make for Word

Try it

Code Snippet

Dim wApp As Word.Application

Dim wDoc As Word.Document

Dim wRange As Word.Range

Dim dcont As String

wApp = CreateObject("Word.Application")

wDoc = wApp.Documents.Open("c:\content.doc")

wRange = wDoc.Content

dcont = wRange.Text

wApp.Quit()

wApp = Nothing

wDoc = Nothing

wRange = Nothing





Re: Getting The Conten Of A Word Document?

KAMACI

Thanks, it worked.