Questions tagged [ms-word]

1

votes
2

answer
33

Views

Symbol for home,delete,download,documents in java

During Java project I got stuck at one point where i want to use symbols for download option,document option,trash option,recent option,picture option,music option and add other location option as presented in NOTEPAD but i don't know how to fetch their symbols in java to print on console or on any...
Shivanshu
1

votes
1

answer
6k

Views

How to find and modify a TextBox in some word document using Microsoft.Office.Interop.Word?

I have to access and change text of some text boxes of some word document by the TextBox id. for example suppose that i have some object named txtDate in a word document and I want to change its content to now's date, so how can i get this object by its id?
Mohsen
1

votes
3

answer
3.3k

Views

How to insert text from RTF to Word Document in c#

I am using winservice for creating Word docs. The only problem I have is to Paste rtf to word Selection. I have this code: private static void PasteRtf(object bookmarkName, OFFICE.Application wordApplication, Document wordDocument, string rtfText, bool winservice) { if(bookmarkName == null || word...
Brusinka
0

votes
0

answer
4

Views

Using MS Word as spell checker in VB.net application on same monitor

I am using the code from http://www.vb-helper.com/howto_net_spellcheck.html that uses Microsoft Word's spell checker and modified slightly to fit my application. But sometimes the spell check window opens on the secondary monitor and need it to open on the same monitor as the VB.net application. Dur...
bikidunker
1

votes
1

answer
62

Views

How can I open Excel from another Office Application without setting references?

From Word and Outlook, I'm trying to open open Excel using GetObject method but I need to set the references first. I receive 'Compile error: User-defined type not defined'. In order to manually fix this, I need to go to Tools>References>Microsoft Excel XX.X Object Library. Is there a way to not...
JSotelo
1

votes
1

answer
6.3k

Views

save word document that's been created dynamically using SaveFileDialog?

I have code that writes text to a Word document (non-XML) and saves it to a file. Now, I'm trying to modify it so that the document is created and the user is then prompted to save the document. This is the code for creating the Word document: object miss = System.Reflection.Missing.Value; object Vi...
1

votes
3

answer
2.7k

Views

Update VSTO Word Addin without VSTO auto-update (no rights for installation for users)

I want to update a VSTO addin for word I create without let VSTO automatic update launch. In fact, my end-users have not enough rights for installing. I only want to update it, not install because first install will be done with vsto installation from VS publish folder with administrator rights. To...
Aelios
1

votes
2

answer
1.8k

Views

Validation of files based on their file extensions

I get files from queues in Java. They may be of following formats. docx pdf doc xls xlsx txt rtf After reading their extensions, I want to validate whether they are actually files of these types. For example, I got a file and checked that it has extension .xls. Afterwards, I want to check whether it...
Ahmad
1

votes
0

answer
94

Views

Creating a save as and send command button in word

I am trying to minimize a daily task by creating a form that will have a save as/send command button. After searching similar posts, I found the code below: How do I define the 'TagNum', 'Date' and 'NTID'? strTagNum = ActiveDocument.SelectContentControlsByTitle('TagNum')(1).Range.Text strNTID = Acti...
azessman
1

votes
1

answer
380

Views

save a mailmerge document

I need to produce and save a MS Word .doc file starting from a template (let's say C:\template.doc) and a datasource (let'say C:\datasource.doc) I'm using MailMerge.Execute and if I let Word to be visible, I see the correct result file, but I can't realize to save this file in any way. The code is:...
Michele Perrotta
1

votes
0

answer
56

Views

PHP Library Create Microsoft Word document with Page Indexing

I have a script which generates a report in Microsoft Word using thePHPWord library. I need a page index which will show the page numbers where each project in the report can be found. I understand that PHPWord does not support page indexing, therefore the existing script which generates the word d...
Eric Lee
1

votes
1

answer
301

Views

DotNetCore.NPOI & .Net Core 2 MVC Web App

I am using DotNetCore.NPOI V1.0.2 in my .NET Core 2 MVC web app. I have been researching for instructions or examples to create .docx document with header and footer without any success. Does anyone know how to create two lines header and footer with page numbers like Page 1/x format?
Charles Yang
1

votes
1

answer
295

Views

Range.InsertXML throws when inserting Open XML

I'm writing a VSTO add-in for Word. I'm manipulating some content controls and have their Range objects. I'm trying to use the Open XML SDK to create XML element objects (OpenXmlElement) such as a Run (Run/w:r) and properties for it. Here's the XML: Hello world this should be bold When I pass this t...
Daniel A. White
1

votes
1

answer
450

Views

Read content of repeating sections with apache POI

I Have a word document with a repeating section, containing other content controls. In java project, I have a function that gets all sdts (content controls) from a word document in apache POI, in a List List. When I inspect my repeating section in that list, I can get the text inside all content co...
Amanite Laurine
1

votes
1

answer
67

Views

Add tab in text sent from Matlab to Word

I would like to write a string containing a tab in Word from Matlab. Here is what I have done: word = actxserver('Word.Application'); selection=word.Selection; selection.TypeText('This document presents the results of ^t my study.') This will not work, it simply displays ^t. I have also tried to u...
Shinagan
1

votes
3

answer
377

Views

Import data from Excel to Word - format number with comma

I created a macro in VBA that allows me to choose a cell populated with a number and pull the number in that cell into a specific location in a word document. However, when I run the macro, the number that is populated into Word is not formatted with commas to separate thousands (e.g. looks like '10...
Ariel Martin
1

votes
1

answer
53

Views

Giving equations specific numbers

I'm new to VBA and I really would appreciate the help. First I should mention that I use OFFICE 2016. I used Macro recording to create a macro that copies the selected equation then it inserts a table (one row,two columns)and adjust it to remove borders. After that the macro pastes the copied equati...
Warlock-993
1

votes
0

answer
250

Views

Copy header from MS Word to Excel

I have an Excel VBA code that copies the content of the MS word file: 'Open PDF file in MS Word Set wordApp = CreateObject('Word.Application') Set wordDoc = wordApp.Documents.Open(PDFfilepath, ConfirmConversions:=False, ReadOnly:=False) With wordDoc Worksheets.Add(After:=Worksheets(Worksheets.Count)...
Edge
1

votes
0

answer
394

Views

How to create table in doc using poi

I try to create table in .doc file. I didn't getting much help to create table in doc using poi. I try below code but it didn't work. It's didn't create table like below screenshot. private static void insertTable() throws FileNotFoundException, IOException { HWPFDocument doc = new HWPFDocument(new...
Divyesh Kanzariya
1

votes
1

answer
717

Views

Sum Column in Table to variable

I'm trying to sum up a column of a table in a word document. It's 3 column table, the length depends on the document. What I'm doing in the macro is the following: I want to sum up the numbers in column 2. Then I'm adding some certain lines (headings in first column, no numbers in column 2) and chan...
mhammer
1

votes
1

answer
117

Views

Why do fonts look different in VS than in Word [closed]

I've been looking for a decent font to use in Visual Studio. I found one called 'office code pro' which seemed to look nice. But when I use it in VS, it looks different than it does in Word (it looks nicer in Word). Is there some reason that VS displays it differently than Word?
Starfleet Security
1

votes
0

answer
118

Views

Protocol handler broken for protected mode in office insider fast build

We're developing Add-ins for Office. For some scenario's we use the protocol handler for Word. When a file is originating from the a location that triggers the 'Protected View', the documents opens with the yellow bar where you can enable editing of the document. When I click 'enable editing' a mess...
Christian
1

votes
1

answer
192

Views

Office.Interop.Word SaveAs says Invalid filename

Using Microsoft.Interop.Word I try to save a Word file (docx). In most cases it saves fine, but just occasionally it doesn't. And I can't figure out what specifically causes the error. The file and path is generated, based on current related data. In this (failing) example the output file path (_fu...
Morten Snedker
1

votes
0

answer
359

Views

Office.context.auth.getAccessTokenAsync throws API not supported while developing Microsoft Word online add-in

I am trying to develop an add-in for Microsoft Word Online. I am using Office.context.auth.getAccessTokenAsync call to get access token of a user, but it throws error: Object { name: 'API Not Supported', message: 'This browser does not support the requested API.', code: 5009 } status: 'failed'...
aaryan
1

votes
1

answer
167

Views

HeadingFormat in word Table Style

I would like to set the option 'Repeat as header row at the top of each page' in word with C# in a table style like 'Table Grid'. I know how to do it if there is a table in the word already: table[1].Rows.HeadingFormat = true The question is how to do it within the table style with C#? thank you.
Thucasimp
1

votes
0

answer
140

Views

Get the Default Table Style of a Word Document (from VSTO add-in)

Question: How can I get the default table style for the document from a C# VSTO addin? Or its name, at least? Caveats: Globals.ThisAddIn.Application.ActiveDocument.DefaultTableStyle doesn't work. Globals.ThisAddIn.Application.ActiveDocument.WordOpenXML doesn't provide the answer. Long Story: When I...
Jacek Kołodziejek
1

votes
2

answer
46

Views

Obtaining the Total Number of Bookmarks Within a Word Document

I am working on word page in Microsoft Office 2013, and I'm adding bookmarks to my page, I need to get a total count of how many bookmarks are on my page. What method can be used to obtain the total number of bookmarks within the document?
Damkulul
1

votes
1

answer
1.2k

Views

Copying Data From Word Document Using Excel VBA

I have an excel file that that has a filename of a word document. I want to use excel vba to open the word document, then search for a specific phrase, copy the characters following that phrase, and paste it back into the original excel file. I have attempted several ways to implement this design,...
msf
1

votes
1

answer
1.1k

Views

C# Line Spacing in Word Interop

I am attempting to create a word document where the line spacing is set to 'No Spacing', or single spacing. I honestly don't know why this is so difficult. I have tried all of these examples with no luck: Paragraph para1 = document.Content.Paragraphs.Add(ref missing); para1.LineSpacingRule = WdLine...
Mark Bonafe
1

votes
0

answer
1.2k

Views

Export HTML (with CSS styles) as Word document (.doc or .docx)

I am trying to export a simple page as a word document but can't seem to find any way to do this. Any method I try simply exports text with font colours but nothing else. What I want is for an export method that uses css styles properly. This is pure html, css and javascript with no back-end languag...
DominicM
1

votes
1

answer
77

Views

How to format enumerated lists from latex to docx

I have several hundred Word documents to generate from latex sources, TEX to DOCX. Pandoc works just fine with one little glitch -- enumerated lists in LaTeX are rendered with Roman numerals in the DOCX output files. I can't seem to find any documentation that addresses this issue, and Word document...
ccc31807
1

votes
1

answer
63

Views

Can PowerShell identify which drop down selection a user makes in a Word Document?

After selecting an option from a drop down menu, and saving the document, can PowerShell identify which selection was made?
JohnSmith
1

votes
1

answer
43

Views

i want to create a VBA code in Word that will create multiple word files with different file names

I want to create multiple saves of the same word file using visual basic. each file will need to be named with the day of the month and month name (not numbers) i want this to run from the 1 to 31 on each month. i have a rough code, Sub Mine() Dim DateStr, FileStr As String DateStr = Format$(Date, '...
Nick Freeman
1

votes
0

answer
35

Views

Getting junk characters while printing word document in php

I am tring to display word document on the screen which was already stored in mysql but i am getting junk charactes. below is the code
manikandan
1

votes
2

answer
680

Views

MS Word, VBA, How to select a paragraph within a cell within a table?

I'm new to using VBA to write macros within MS Word. I've worked out how to select the cell within the table, but it doesn't appear I can use the paragraph object with it... or, more likely, I'm doing it wrong. Essentially, what I'm trying to do, it look for phrase 'as follows:' within all the pa...
Fatal.Lordes
1

votes
0

answer
387

Views

3 State Checkbox

I am using Microsoft Word 2013 and inserting a CheckBox from the developer tab. I want to have a 3-state CheckBox (checked, intermediate, and unchecked), but whenever I pull up the properties of the CheckBox, it only gives me the options for a 2-state CheckBox (checked and unchecked). Is there anywa...
David
1

votes
1

answer
216

Views

Maintain formatting when merging word documents in C#

I've searched and have been unable to find the right solution. I have multiple word documents I wish to merge. When I go to merge I lose the page formatting (single line spacing and 0pt for space before and space after) When I merge, these settings revert back to multi line and 8pt for space after....
RyanC
1

votes
1

answer
133

Views

In MS Word, how can I get a Table Of Contents without the text in headings?

After applying heading, the result I want is like this: the upper line with the word 'Chapter' and a automatic number of chapter, and the lower line with the name of chapter And corresponding table of contents need just take the number of chapter and the name of chapter, not the word 'Chapter', like...
Alex
1

votes
1

answer
341

Views

Can not get the text in ContentControl in Word by usting Python-docx

ContentControl Document I am new to the Python and coding. New I have a problem and need your help. I tried to read a docx document by using Python-docx, but all of the text I wanted were in the ContentControl. When I try to print the text of the paragraph with a ContentControl, error occurs. For ex...
You Yangyang
1

votes
0

answer
80

Views

Can I use range.InsertXML in footnotes?

I have a VSTO Add-in in which I insert some formatted text into Selection.Range. Text is provided in Open XML format and is inserted to the document with InsertXML method: using (var selection = _application.Selection) { var range = selection.Range; range.Collapse(WdCollapseDirection.wdCollapseEnd);...
aurel

View additional questions