Solved

How to identify the current document in an MSWord 2007 VB.net add-in

Posted on 2009-05-05
1
242 Views
Last Modified: 2013-11-10
I am writing an add-in that saves the current document to a temp directory for additional processing. I placed a a button on a ribbon in my project and now I cannot figure out how to instanciate the current document to get its properties and save it to the temp directory. Can someone please help out with the VB.net code to identify the current document. Note that I am using Word2007 and Visual Studio 2008 SP1. Thanks
0
Comment
Question by:qwerty360
1 Comment
 
LVL 23

Accepted Solution

by:
irudyk earned 500 total points
ID: 24308837
You could try using Application.ActiveDocument
So, for example, if your addin is named ThisAddIn, you could get the attributes of the active document by using
Globals.ThisAddIn.Application.ActiveDocument
For example
Globals.ThisAddIn.Application.ActiveDocument.Path
would return the path of the current document
Is that what you are looking for?
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now