Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2009-05-05
1
Medium Priority
?
253 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 2000 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

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

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

A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
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…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…

885 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