Questions tagged [word-2007]

Microsoft Word 2007 is a commercial document editing program used for creating richly formatted documents for printing and distribution.

Microsoft Word 2007 is a commercial document editing program used for creating richly formatted documents for printing and distribution.

It is the first version to feature the new UI from Microsoft, called the Ribbon.

This tag should be used to indicate your version of Word when posting a question. You should also tag your question word-vba if asking about VBA usage in Word 2007.

Related Tags:

Links:

175 questions
15
votes
2 answers

VBA error 'Wrong number of arguments or invalid property assignments' when running macro via custom button

I have a macro that I call via a tab/group/button added by the Custom UI Editor -
David Gard
  • 11,225
  • 36
  • 115
  • 227
11
votes
3 answers

Word VBA "Project is unviewable"

Does anyone know how to make a template viewable in Word 2007? I created a template, Experiments.dotm, added it using Add-Ins, but when I try to create a module within it, get an error message: "Project is unviewable"
Bruce
  • 153
  • 1
  • 1
  • 10
9
votes
8 answers

Add a filename field without .doc extension in document header

Working in Office 2007, I'd like to add a filename field in my document header. The document will later be a PDF, so I don't want the extension. I've played with Insert -> QuickParts -> Field, to no avail. I've got a gut feeling that it requires a…
Ben
  • 54,723
  • 49
  • 178
  • 224
9
votes
6 answers

How do you change the content of a content control in Word 2007 with OpenXml SDK 2.0?

About to go mad with this problem. I'm sure it's so simple I'm just missing it, but I cannot for the life of me find out how to change the content of a content control in Word 2007 with the OpenXml SDK v2.0 in C#. I have created a Word document with…
Jason
  • 8,400
  • 10
  • 56
  • 69
8
votes
2 answers

Clear / Empty Variable for next loop

I am having a situation in which I need to clear the variable lastWord so that msgbox show nothing in next loop. Following code is just an Example. Sub clear_lastWord_Variable() Dim wordArr() As String Dim lastword As String Do …
VBAbyMBA
  • 806
  • 2
  • 12
  • 30
8
votes
1 answer

How to Jump to a Bookmark in Word-VBA and insert text?

I am trying to create a Word document with a very simple word macro. The macro searches for a bookmark that I have placed in the text and then adds a date, 2 weeks into the future, at that location. But when I create a new document from the template…
Patrick
  • 5,442
  • 9
  • 53
  • 104
8
votes
1 answer

How can I use Microsoft Word's spelling/grammar checker programmatically?

I want to process a medium to large number of text snippets using a spelling/grammar checker to get a rough approximation and ranking of their "quality." Speed is not really of concern either, so I think the easiest way is to write a script that…
Andrew Keeton
  • 22,195
  • 6
  • 45
  • 72
7
votes
2 answers

How to create an automatic Revision History table in Word 2007

Is it possible in Word 2007 to create a revision history table automatically using track changes or some other method? e.g. Revision History DateVersionDescriptionAuthor 16/09/20081.0CreatedJohn Smith 17/09/20081.1Fixed dumb spelling errorsColin…
John Hunter
  • 4,042
  • 4
  • 26
  • 35
7
votes
3 answers

Insert HTML into OpenXML Word Document (.Net)

Using OpenXML SDK, I want to insert basic HTML snippets into a Word document. How would you do this: Manipulating XML directly ? Using an XSLT ? using AltChunk ? Moreover, C# or VB examples are more than welcome :)
Nico
  • 13,320
  • 6
  • 32
  • 33
6
votes
1 answer

Is there an inverse mode for Microsoft Word?

I'm wondering if there's any way to invert the colors in Microsoft Office Word - that is, view white text on a black background. I mainly ask because I'm used to dark color schemes a la Notepad++ themes and similar, and so much white space is really…
crazedfred
  • 133
  • 1
  • 1
  • 8
6
votes
5 answers

What is the best way to populate a Word 2007 template in C#?

I have a need to populate a Word 2007 document from code, including repeating table sections - currently I use an XML transform on the document.xml portion of the docx, but this is extremely time consuming to setup (each time you edit the template…
user32826
6
votes
3 answers

Run-time error when canceling a 'Save As' dialog displayed via VBA

I have a macro that formats a document in a certain way, and then saves it, using ActiveDocument.Save. However, sometimes the document is not already saved, and in some cases I don't want to save it. Unfortunately, clicking 'Cancel' when the 'Save…
David Gard
  • 11,225
  • 36
  • 115
  • 227
6
votes
2 answers

Don't add changes made via VBA to the undo history

I have a set of Word macro's that format documents that are sent to from an external source. Usually there are a lot of changes made to the document, all of which are recorded in the undo history, which I don't want. Is there a way to not add all of…
David Gard
  • 11,225
  • 36
  • 115
  • 227
6
votes
1 answer

Change text backgroundcolor in Word

the situation: .net 3.5 c# or vb.net(also tested) word 2007 add-in I'm trying to set the Background Color of the text to a custom rgb color. The code is the following: Range r = this.Application.ActiveDocument.Range(); r.Text =…
lnu
  • 1,404
  • 1
  • 9
  • 25
5
votes
3 answers

Update embedded excel file programmatically

I'm trying to modify an embedded excel table in a word document programmatically. To do this, I have modified the docx file and the embedded excel file. The significant part of the main document is the following:
Scharrels
  • 3,055
  • 25
  • 31
1
2 3
11 12