Search Results

Search found 237 results on 10 pages for 'msword'.

Page 4/10 | < Previous Page | 1 2 3 4 5 6 7 8 9 10  | Next Page >

  • Word mergefield wildcard not correctly matching

    - by aZn137
    Hello, Below is my mergefield code: { IF { MERGEFIELD Subs_State } = "GA" "blah blah" "{ IF { MERGEFIELD CEOrgStates } = "GA" "blah blah" ""} "} I'm pulling records from a MS Access db. My goal is to check whether a record has Subs_State field matching "GA", or the CEOrgStates has the word "GA" (some records have stuff like "|FL|CA|GA|CT|KY|" (no quotes)). When I merged the docs, Word doesnt seem to be able to match with the wildcards: If I use and compare "*GA" (fields ending with GA), it works; however, the double wildcards "*GA*" dont seem to work at all. Here are the things I’ve tried: Have data in lowercase, then compare with lowercase Have data in lowercase, convert to and then compare with uppercase Do the opposite of the above 2 with uppercase data Use “*GA*” and “*ga*” (no pipe) Use different delimiters Nothing seems to work with the double wildcard matching. What am I doing wrong? Thanks!

    Read the article

  • Add a custom Ribbon group to an existing custom Ribbon group in word 2007

    - by SwiftLion
    Hi How can I add a new group to an existing (3rd party) custom ribbon tab add-in? I know that I can add to out of box ribbons by specifying the Tabs idMSo value but how do I do that for a custom ribbon tab. I have already tried the ID value of the custom ribbon, but it juts duplicates the ribbon? have also tried idMso and idQ attributes passing in the required custom tab Id but no success. I can add it to out of box tab group by specifying the idMso value but not to custom tab regards

    Read the article

  • Syntax highlighting in MS Word document

    - by ArunSaha
    I want to insert some C/C++ source code into a Microsoft Word document. I have no problem in copying the code from source file and pasting into Word. I can do fixed-width. But, in Word, I see the code in black-and-white format; I loose the syntax highlighting as I get in the source code editor (for me, gvim). So, my question is, is there any way to do syntax highlighting of C/C++ source code in MS Word?

    Read the article

  • C# Spell checker Problem

    - by reggie
    I've incorporated spell check into my win forms C# project. This is my code. public void CheckSpelling() { try { // declare local variables to track error count // and information int SpellingErrors = 0; string ErrorCountMessage = string.Empty; // create an instance of a word application Microsoft.Office.Interop.Word.Application WordApp = new Microsoft.Office.Interop.Word.Application(); // hide the MS Word document during the spellcheck //WordApp.WindowState = WdWindowState.wdWindowStateMinimize; // check for zero length content in text area if (this.Text.Length > 0) { WordApp.Visible = false; // create an instance of a word document _Document WordDoc = WordApp.Documents.Add(ref emptyItem, ref emptyItem, ref emptyItem, ref oFalse); // load the content written into the word doc WordDoc.Words.First.InsertBefore(this.Text); // collect errors form new temporary document set to contain // the content of this control Microsoft.Office.Interop.Word.ProofreadingErrors docErrors = WordDoc.SpellingErrors; SpellingErrors = docErrors.Count; // execute spell check; assumes no custom dictionaries WordDoc.CheckSpelling(ref oNothing, ref oIgnoreUpperCase, ref oAlwaysSuggest, ref oNothing, ref oNothing, ref oNothing, ref oNothing, ref oNothing, ref oNothing, ref oNothing, ref oNothing, ref oNothing); // format a string to contain a report of the errors detected ErrorCountMessage = "Spell check complete; errors detected: " + SpellingErrors; // return corrected text to control's text area object first = 0; object last = WordDoc.Characters.Count - 1; this.Text = WordDoc.Range(ref first, ref last).Text; } else { // if nothing was typed into the control, abort and inform user ErrorCountMessage = "Unable to spell check an empty text box."; } WordApp.Quit(ref oFalse, ref emptyItem, ref emptyItem); System.Runtime.InteropServices.Marshal.ReleaseComObject(WordApp); // return report on errors corrected // - could either display from the control or change this to // - return a string which the caller could use as desired. // MessageBox.Show(ErrorCountMessage, "Finished Spelling Check"); } catch (Exception e) { MessageBox.Show(e.ToString()); } } The spell checker works well, the only problem is when I try to move the spell checker the main form blurs up for some reason. Also when I close the spell checker the main form is back to normal. It seems like it is opening up Microsoft word then hiding the window, only allowing the spell checker to be seen. Please help.

    Read the article

  • Active printer problem in Printing word document through VB.net

    - by sweety
    Hi My printer name is \\abc\First Floor A-Block its taking name \abc\First Floor A-Block on NE04:. How should i print it Private oWord As Word.Application Dim lobjDoc As Word.Document Dim strFolder as String Dim pd As New PrintDocument Dim strPrintername as String oWord = CreateObject("Word.Application") oWord.DisplayAlerts = Word.WdAlertLevel.wdAlertsNone oWord.ActivePrinter =strPrintername strFolder="D:\testdoc.prn" ' Here I am giving the printer name which is on network, But its taking name \abc\First Floor A-Block on NE04: lobjDoc = oWord.Documents.Open(CType(strFolder, Object)) lobjDoc.PageSetup.FirstPageTray = Word.WdPaperTray.wdPrinterAutomaticSheetFeed lobjDoc.PageSetup.OtherPagesTray = Word.WdPaperTray.wdPrinterAutomaticSheetFeed lobjDoc.PrintOut(Background:=False, Append:=False, OutputFileName:=strFolder, PrintToFile:=True) 'here its giving error about printer settings lobjDoc.Close(SaveChanges:=False) Is there any way to print word document with all its content through PrintDocument? thanks

    Read the article

  • Why doesn't my CreateRibbonExtensibilityObject method get called?

    - by DGGenuine
    Hi I've been tinkering around with the two techniques to modify the ribbon with an MS Word addin (Visual Studio 2010, .NET 3.5), a Microsoft.Office.Tools.Ribbon.OfficeRibbon and Microsoft.Office.Core.IRibbonExtensibility. I was hoping to switch between the two in my addin's CreateRibbonExtensibilityObject, but for some reason it is not called now. The documentation says that if an addin implements CreateRibbonExtensibilityObject that it will be called. When I create a fresh project to test doing this very thing, it works. I'd prefer not to abandon my project as-is. Any ideas? Thank you.

    Read the article

  • Need suggestions on how to extract data from .docx/.doc file then into mssql

    - by DarkPP
    I'm suppose to develop an automated application for my project, it will load past-year examination/exercises paper (word file), detect the sections accordingly, extract the questions and images in that section, and then store the questions and images into the database. (Preview of the question paper is at the bottom of this post) So I need some suggestions on how to extract data from a word file, then inserting them into a database. Currently I have a few methods to do so, however I have no idea how I could implement them when the file contains textboxes with background image. The question has to link with the image. Method One (Make use of ms office interop) Load the word file - Extract image, save into a folder - Extract text, save as .txt - Extract text from .txt then store in db Question: How i detect the section and question. How I link the image to the question. Extract text from word file (Working): private object missing = Type.Missing; private object sFilename = @"C:\temp\questionpaper.docx"; private object sFilename2 = @"C:\temp\temp.txt"; private object readOnly = true; object fileFormat = Word.WdSaveFormat.wdFormatText; private void button1_Click(object sender, EventArgs e) { Word.Application wWordApp = new Word.Application(); wWordApp.DisplayAlerts = Word.WdAlertLevel.wdAlertsNone; Word.Document dFile = wWordApp.Documents.Open(ref sFilename, ref missing, ref readOnly, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing); dFile.SaveAs(ref sFilename2, ref fileFormat, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing,ref missing, ref missing,ref missing,ref missing,ref missing,ref missing, ref missing,ref missing); dFile.Close(ref missing, ref missing, ref missing); } Extract image from word file (Doesn't work on image inside textbox): private Word.Application wWordApp; private int m_i; private object missing = Type.Missing; private object filename = @"C:\temp\questionpaper.docx"; private object readOnly = true; private void CopyFromClipbordInlineShape(String imageIndex) { Word.InlineShape inlineShape = wWordApp.ActiveDocument.InlineShapes[m_i]; inlineShape.Select(); wWordApp.Selection.Copy(); Computer computer = new Computer(); if (computer.Clipboard.GetDataObject() != null) { System.Windows.Forms.IDataObject data = computer.Clipboard.GetDataObject(); if (data.GetDataPresent(System.Windows.Forms.DataFormats.Bitmap)) { Image image = (Image)data.GetData(System.Windows.Forms.DataFormats.Bitmap, true); image.Save("C:\\temp\\DoCremoveImage" + imageIndex + ".png", System.Drawing.Imaging.ImageFormat.Png); } } } private void button1_Click(object sender, EventArgs e) { wWordApp = new Word.Application(); wWordApp.Documents.Open(ref filename, ref missing, ref readOnly, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing); try { for (int i = 1; i <= wWordApp.ActiveDocument.InlineShapes.Count; i++) { m_i = i; CopyFromClipbordInlineShape(Convert.ToString(i)); } } finally { object save = false; wWordApp.Quit(ref save, ref missing, ref missing); wWordApp = null; } } Method Two Unzip the word file (.docx) - Copy the media(image) folder, store somewhere - Parse the XML file - Store the text in db Any suggestion/help would be greatly appreciated :D Preview of the word file: (backup link: http://i.stack.imgur.com/YF1Ap.png)

    Read the article

  • Office Automation: What does destroy my encoding?

    - by Filburt
    I'm facing a problem with a Word Mail Merge Automation controlled by our CRM system. The setup Base for the Mail Merge is a Word .dot template which fires a macro on Document.New. Inside this macro I create a .Net component registered for COM. Set myCOMObject = CreateObject("MyCOMObject") The component pulls some data from a database and hands string values which are assigned to Word DocumentVariables. Set someClass = myCOMObject.GetSomeClass(123) ActiveDocument.Variables("docaddress") = someClass.GetSenderAddress(456) All string values returned from the component are encoded in UTF-8 (codepage 1200). What happens The problem arises when the CRM system calls Word to perform the Mail Merge: The string values from the component are turned into UTF-8 encoded strings. All the static text inside the template and the data pulled for the Mail Merge stay nicely encoded in UTF-16 - example the umlaut ü inside my DocumentVariables is turned into c3 b0 while it stays fc for the rest of the document (checked file in hex editor). If I'm creating a document from a template with the same macro functionallity but without performing a Mail Merge all strings are fine; i.e. are encoded in UTF-16. What changed According to the CRM software vendor the encoding of the Mail Merge data export was changed to UTF-16 with the new version we're currently testing. I found out that MS states that you'll expirience issues when the document and the Mail Merge data file encoding don't match. What I tried Since I'm assuming to merge with UTF-16 encoded data I added the following lines to my macro: ActiveDocument.TextEncoding = msoEncodingWestern ActiveDocument.SaveEncoding = msoEncodingUnicodeLittleEndian This is what the Mail Merge data document specifies in its document properties.

    Read the article

  • What's a good Java API for creating Word documents?

    - by Bill James
    I have a new app I'll be working on where I have to generate a Word document that contains tables, graphs, a table of contents and text. What's a good API to use for this? How sure are you that it supports graphs, ToCs, and tables? What are some hidden gotcha's in using them? Some clarifications: I can't output a PDF, they want a Word doc. They're using MS Word 2003 (or 2007), not OpenOffice Application is running on *nix app-server It'd be nice if I could start with a template doc and just fill in some spaces with tables, graphs, etc. Thanks for the help. Edit: Several good answers below, each with their own faults as far as my current situation. Hard to pick a "final answer" from them. Think I'll leave it open, and hope for better solutions to be created. Edit: The OpenOffice UNO project does seem to be closest to what I asked for. While POI is certainly more mainstream, it's too immature for what I want.

    Read the article

  • Best way to show code snippets in word?

    - by Larry
    Does anyone know a good way to display code in Microsoft Word documents? I have tried to include code as regular text which looks awful and gets in the way when editing regular text. I have also tried inserting objects, a WordPad document and Text Box, into the document then putting the code inside those objects. The code looks much better and is easier to avoid while editing the rest of the text. However, these objects can only span one page which makes editing a nightmare when several pages of code need to be added. Lastly, I know that there are much better editors/formats that have no problem handling this but I am stuck working with MS word.

    Read the article

  • When developing a Microsoft Office Add-In (for Word), is it possible to store hidden metadata inform

    - by leftend
    I am trying to store metadata (basically a unique id) along with each cell of a table in a Word document. Currently, for the add-in I'm developing, I am querying the database, and building a table inside the Word document using the data that is retrieved. I want to be able to save any of the user's edits to the document, and persist it back to the database. My initial thought was to store a unique id along with each cell in the table so that I would be able to tell which records to update. I would also like to store some sort of "isChanged" flag within each cell so that I could tell which cells were changed. I found that I could add the needed information into the "ID" property of the cell - however, that information was not retained if the user saved the document, closed it, and re-opened it. I then tried storing the data by adding a data to the "Fields" collection - but that did not work and threw a runtime error. Here is the code that I tried: object t1 = Word.WdFieldType.wdFieldEmpty; object val = "myValue: " + counter; object preserveFormatting = true; tbl.Cell(i, j).Range.Fields.Add(tbl.Cell(i, j).Range, ref t1, ref val, ref preserveFormatting); This compiles fine, but throws this runtime error "This command is not available". So, is this possible at all? Or am I headed in the wrong direction? Thanks in advance.

    Read the article

  • Runtime.getRuntime.exec() problem with running Word document

    - by Milan
    Hello everybody! when I write in commandline in windows: C:\Program Files (x86)\Microsoft Office\Office12>winword.exe /mOpenPage c:\Navod ilo.doc It starts the word document with the macro /mOpenPage. I want to do the same thing from Java but its not going. String[] cmd = {"cmd.exe","/c","start","c:\\Program Files (x86)\\Microsoft Office\\Office12\\WINWORD.exe","/mOpenPage","c:\\Navodilo.doc"}; Process proc = Runtime.getRuntime().exec(cmd); help?

    Read the article

  • Open XML document ContentControls problem with signed id's

    - by willvv
    I have an application that generates Open XML documents with Content Controls. To create a new Content Control I use Interop and the method ContentControls.Add. This method returns an instance of the added Content Control. I have some logic that saves the id of the Content Control to reference it later, but in some computers I've been having a weird problem. When I access the ID property of the Content Control I just created, it returns a string with the numeric id, the problem is that when this value is too big, after I save the document, if I look through the document.xml in the generated document, the <w:id/> element of the <w:sdtPr/> element has a negative value, that is the signed equivalent of the value I got from the Id property of the generated control. For example: var contentControl = ContentControls.Add(...); var contentControlId = contentControl.ID; // the value of contentControlId is "3440157266" If I save the document and open it in the Package Explorer, the Id of the Content Control is "-854810030" instead of "3440157266". What have I figured out is this: ((int)uint.Parse("3440157266")).ToString() returns "-854810030" Any idea of why this happens? This issue is hard to replicate because I don't control the Id of the generated controls, the Id is automatically generated by the Interop libraries.

    Read the article

  • Intercepting hyperlinks in an embedded Word document

    - by Ryan
    Hello, I'm working on an app which uses embedded Word documents. We have a feature which allows them to insert a small clickable image into the doc - when the user clicks on it, we want the app to open another window based on some data specified by the user when the image was added. What the application does now is: When the image is inserted, the app creates a hyperlink for it and the data is used as the link destination The user ctrl+clicks on the image and the Word document the WindowSelectionChange event The app handles the WindowSelectionChange event and goes to open the specified window This approach worked fine with previous versions, when we had the 11.0 / Word 2003 interop dll's. We upgraded to 12.0/Word 2007 for the upcoming release, and in many cases the event is not firing when I click on the image - sometimes it does, sometimes it doesn't, and I'm descending into the cargo-cult world trying to figure out why - sometimes saving and re-opening the document works, sometimes killing the Word process and starting a new one fixes (or breaks) the feature. My guess is there's something going wrong with the WinSelChg event, but I'm not sure what. The usual process we have for applying the event handler is: try //remove the old one if any { ((Document)myAXFramerControl.ActiveDocument).Application.WindowSelectionChange -= new ApplicationEvents4_WindowSelectionChangeEventHandler(WSC_eventhandlerfunction); } catch{} ((Document)myAXFramerControl.ActiveDocument).Application.WindowSelectionChange += new ApplicationEvents4_WindowSelectionChangeEventHandler(WSC_eventhandlerfunction); Sometimes one or both of these will throw exceptions - usually a NullReferenceException when removing the handler. Adding the handler sometimes throws the "com object that has been separated from its underlying rcw cannot be used" exception, which I don't understand at all - my impression was that this only occurs when you, say, store a reference to the Word application or document and try to use it later. As it stands the WSC event handler is frequently never run; while I'm happy to fiddle with the app until it works once I can't really expect the same of the users who have been happily using this feature for a while now. Any ideas?

    Read the article

  • Create Word/RTF file with table of contents from Java

    - by Glen
    Hi, I want to create a Word or RTF file with a table of contents (with links to each section) from Java. From my understanding, iText & Apache POI do not support generating a table of contents. Some clients of the app still use older versions of Word, so I need a library that supports the older Word doc format. Does anyone know how I can do this? Thanks, Glen

    Read the article

  • Multiline code in Word 2007

    - by WaelJ
    I am using word 2007 and am inserting code into the document. I have a style with a fixed-width font and light grey background and all, and I use Notepad++ for syntax highlighting. My problem is with a "line" of code that is too long to display, so is there a way to auto-insert an arrow symbol at the beginning of a such lines to indicate that it is the same line (kind of like hyphenating, except on long lines instead of long words) So for e.g. something like this: public static void foo(String abcdefg, Boolean 123, ?String xyz)

    Read the article

  • Storing UTF-8 XML using Word's CustomXMLPart or any other supported way

    - by wpfwannabe
    I am writing a Word add-in which is supposed to store some own XML data per document using Word object model and its CustomXMLPart. The problem I am now facing is the lack of IStream-like functionality for reading/writing XML to/from a CustomXMLPart. It only provides BSTR interface and I am puzzled how to handle UTF-8 XMLs with BSTRs. To my understanding an UTF-8 XML file should really never have to undergo this sort of Unicode conversion. I am not sure what to expect as a result here. Is there another way of using Word automation interfaces to store arbitrary custom information inside a DOCX file?

    Read the article

  • How to import a macro file (previously exported as .bas file) to Microsoft Word using command line?

    - by Nam Gi VU
    I'm writing a command-line program that has a step in which I need to replace text in a Word file. The replacing task is accomplished using Word macro. What I need to do now is to call this macro from command-line. At the moment we can do this by using the -mMacroName parameter of 'winword.exe', i.e. \winword.exe -mMacroName. But this need the macro to be already available as a global macro. Since I need to run the program on another computer, I need to import the above replacing macro programatically... and I don't know how to do this. Please help.

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10  | Next Page >