Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / April 2007

Tip: Looking for answers? Try searching our database.

Word Addin How can I select the using file?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
dev - 17 Apr 2007 17:02 GMT
Hi,
I'd like to create an Add-in that put the name of the document I using with
Word to another external process.
I did an Add-in that can start an external process, but I can't get the name
of the document I using.

Can you help me?

thanks
Perry - 17 Apr 2007 19:36 GMT
What do you mean "external process"?

Do you mean
- another Office application?
- another application? If so, what?

--
Krgrds,
Perry

System:
Vista/Office Ultimate
VS2005/VSTO2005 SE

> Hi,
> I'd like to create an Add-in that put the name of the document I using
[quoted text clipped - 7 lines]
>
> thanks
dev - 17 Apr 2007 19:58 GMT
Thank you for the reply.

I mean my custom application written in Java. I need to put the name of the
document as an input parameter.
for example:

java mainclass documentName

I can start my application "java mainclass" but I need to put the parameter.
thank you again

> What do you mean "external process"?
>
> Do you mean
> - another Office application?
> - another application? If so, what?
Perry - 17 Apr 2007 21:53 GMT
One way:
Store the filename in a textfile.
You can retrieve the filename by reading this textfile in the other app.

--
Krgrds,
Perry

System:
Vista/Office Ultimate
VS2005/VSTO2005 SE

> Thank you for the reply.
>
[quoted text clipped - 14 lines]
>> - another Office application?
>> - another application? If so, what?
dev - 17 Apr 2007 22:20 GMT
My problem is that I don't know how to get the name of the document opened.

How can I get the file name of the opened document?

For example
The user opened the file named "myTest.doc" and, clicking on a Custom button
of the Add-in, the Add-in have to put the string "myTest.doc" in some place.
How can I get that string in vb?

thank you very much.
Perry - 17 Apr 2007 22:35 GMT
If "myTest.doc" is the active document in the active Word session you could
go:
Dim sFullFileName As string
sFullFileName = ActiveDocument.FullName

or if you have an object variable [MyDoc] pointing to document "myTest.doc"
Dim sFullFileName As string
sFullFileName = MyDoc.FullName

Write sFullFileName to a textfile and you can read it in the other app.

--
Krgrds,
Perry

System:
Vista/Office Ultimate
VS2005/VSTO2005 SE

> My problem is that I don't know how to get the name of the document
> opened.
[quoted text clipped - 9 lines]
>
> thank you very much.
dev - 18 Apr 2007 09:38 GMT
At first, I wanna thank you for your support.

So, I if put that code in che onConnection method, I have one error becouse
VS don't know "ActiveDocument", "ActiveDocument don't declared" and I can't
build the project.

I used this code becouse unfortunally I have not [MyDoc] object.

> Dim sFullFileName As string
> sFullFileName = ActiveDocument.FullName

thank u again.

> If "myTest.doc" is the active document in the active Word session you could
> go:
[quoted text clipped - 10 lines]
> Krgrds,
> Perry
Cindy M. - 23 Apr 2007 14:33 GMT
Hi =?Utf-8?B?ZGV2?=,

> So, I if put that code in che onConnection method, I have one error becouse
> VS don't know "ActiveDocument", "ActiveDocument don't declared" and I can't
[quoted text clipped - 4 lines]
> > Dim sFullFileName As string
> > sFullFileName = ActiveDocument.FullName

ActiveDocument is a property of the Application object. You have to start have
a variable assigned to the Word.Application, for example wdApp:
   wdApp.ActiveDocument.FullName

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :-)
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.