Solved

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

Posted on 2009-05-05
1
243 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

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
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…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

821 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