Solved

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

Posted on 2009-05-05
1
244 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
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…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

737 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