I'm using a VI from the MS Word/Excel Report Generation toolkit called Word Insert Field. I have an MS Word document with a named bookmark. I want to replace the bookmark text programmatically from LabVIEW. I believe WordInsert Field is the right VI, but I can't find the proper input for type- there are something like 100 choices. I just want to replace the bookmark text with the text I have provided in the text input. Should be simple...
In the example in the attached file, I'm trying to insert the text "XXX1234" at the bookmark named LotNum in the Word file BookTest.docx. I don't know what to choose for the type constant. There are many choices, and none I've tried work correctly.
Thanks for the suggestion. Append Report Text does indeed insert the desired text at the bookmark location, but it doesn't replace the existing text that I've defined as the bookmark. It just appends. I want to programmatically update the contents of the bookmark (lot number, in this case) and then save the document with the updated text. So I think (hope) Word Insert Field is the right VI.
I have been able to replace existing text at a bookmark using Labview. My solution uses Word macros. In the Word template you use for your document, you create a Word macro that locates the bookmark you want. It is easier to create a macro for each bookmark but I think that you can pass the bookmark name as a parameter but it is not my area of expertise. Then, you create another macro that just deletes the number of characters you want to erase (once again, you can probably pass the number of characters as a parameter if you are a passable Word macro programmer). Then, you insert the new text at the bookmark. See code below.
Oops, I marked my reply as a solution, when I intended to mark your reply as the solution. Sorry about that. I do appreciate your help, and you certainly deserve credit for the help you've given me. Chalk it up to me being a beginner user of the formus... thanks again.
I trying to create a Word document via C#. I want to be able to insert a page break at a certain point in my code, however I am not sure on how to do this. I am mostly using StringBuilder to create the html.This is being done in Visual studios 2010 with c#. I've looked at some guides but most of them use code like "Word variable". So I'm not sure if "Word" comes from an extra downloaded library or what not.
Here is an example of writing some text to the word doc then adding a page break. Then writing the rest to the text to the document. In order to get a better answer you may need to rewrite your question as it is unclear when you want to insert a break and how you are writing the information to the document. I am assuming a lot which is never good.
A long time MS/Office user here... I'm attempting to insert or paste (I've tried both) a picture into a Word 365 document. It shows the outline of the picture, but that's it. I can go to Excel, Paint, etc. and it pastes just fine. Also, prior to maybe a couple of weeks ago I've been able to paste or insert pictures with no issues. I can paste text with no issues. I suspect there may be a virus, but Norton 360 doesn't pick up anything when I do a thorough scan. Suggestions???
I tested several inserts and pastes of pictures and they show up just fine. I'm not sure how this situation happened though. I haven't adjusted the settings in the Options sections, so perhaps a SW update modified the selection. Regardless, thank you again for your assistance!!
We seem to have the same document version, and I wasn't able to replicate the issue you're experiencing. From your previous message, it seems like you've already tried the solution we provided without success.
If you're working with an older document created in Microsoft versions 2010 or 2013, try checking compatibility. For newer documents, skip this step. You can do this by going to File > Info > Check for Issues > Check Compatibility.
If you want to have text and lines between two tables, both tables must be "inline" with the text (Wrapping = None) in order to put text between them. If one of the two tables is floating above the text (Wrapping = Around) with the text moving around it, you can't insert text in-between.
Place the cursor at the end of the first table.Then press Ctrl+Shift+Enter. It will break the last row of table to create a free row, where u could write the texts. Then the breaked table row can be deleted by selecting it and press Ctrl+X
I had the same problem, caused by cutting two tables out of a web page and pasting them into Word. I kicked myself when I stopped to think - if it's genuinely two tables as it was in my case, select the second one, cut it, add a new line or two below the first table then paste the second table back after the newline. Simples.
I'm using Affinity Designer to generate figures for my PhD thesis which I then insert into a MS Word document. My figures normally consist of both vector designs as well as microscopy images, so pixel based. As I mix figures with a lot of text, I need to use a mix of Affinity Designer and Word.
I have tried several export options for my affinity files, but am completely confused which one would be the best for this purpose. I have to slightly resize my figures in Word as I have to fulfil different page setups for different projects and want to keep the figure the same. Thus, I was thinking a PDF file would be best as I still keep the vector properties. However, there are so many different PDF options that I am unsure which one to use. The word document will later be printed but also read on a screen, so transformed into a PDF document in the end (actually for both printing and screen use).
What Catshill wrote for raster images, for vectors you could try eps.
A quick test using an ancient Word 2010 doesn't show the red stroke for emf, wmf works but both of these formats import into Word as ginormous images, they were resized to fit on the screen together, eps matches the size set in Affinity rather well, ie a 50 x 50mm star imports as 50.01 x 50.01mm
I tested this and noticed that having a 96DPI Designer RGB document and copy pasting as SVG (the appropriate Clipboard option needs to be checked in Edit > Preferences > General) works pretty well at least on Windows and up-to-date Office-365 version of Word. Exporting to WMF and converting text to curves works also fine but placed graphic needs to be manually resized. Leaving text as text left artifacts. EMF exports would import fine, but would fail when subsequently exporting to PDF.
I did not test this on macOS, but as WMF is not available there, would imagine that SVG is the best vector option there. However, on macOS PDF format might also be supported, also via Clipboard (on Windows Word I could not make PDF imports work properly, perhaps it requires some extra modules installed if it is supported, at all).
UPDATE: I now tested this on macOS, and there PDF format works very well both when pasted via Clipboard and when placing Affinity Designer created PDFs in Word. The PDFs are also placed in their correct sizes in Word documents and export without problems. On the other hand, it seems SVG is not a supported Clipboard format between Affinity apps and Word.
UPDATE2: Exporting to PDF and placing them in Word on Windows works fine, too, even if it seems that objects need to be resized (it appears that they are placed at 300 dpi resolution no matter what the nominal resolution used at export is). In Word, the PDFs need to be placed by using Insert > Object (under Text group) > Create from File (instead of placing a picture). Word can also place an interpreted and editable PDF if a PDF is placed as Insert > Object > Text from file, but there are probably many kinds of errors in interpretation.
UPDATE3: PDFs placed in a Windows Word document are actually low-res rasterizations! It is a shame, and totally absurd that Microsoft has not implemented similar support for PDFs as there exists on macOS versions of Office apps!
So in a nutshell: on macOS, vectors can be exported to Word in PDF format, and can be used both via Clipboard and as placed graphic [to be passed through]; on Windows, vectors can be exported in WMF format (text as curves) and placed in a Word document (resizing typically needed), but not transferred via Clipboard (this is not supported by Affinity apps); or: copy pasted in SVG format when enabling the appropriate option in the Preferences. But exporting to SVG files and then placing in Word has several flaws and does probably only work with very simple drawings.
Pasting text from a Word document inserts lots of line breaks. Didn't have this problem before January's update but maybe I'm doing something wrong. Pasted text from Notepad works so there must be something about Word formatting.
@AGP - Thanks for reporting this. The extra line breaks are a known issue with the desktop/native version of Microsoft Word and some other desktop apps. We are looking into addressing this in a future update.
The copying improvements mentioned in the blog apply to situations where you're copying text from within the same StoryMap, a different StoryMap, most web pages, and most web-based editing/note-taking apps.
For now, if you can open your document in the web version of Word copying text will work much better. In general, web-based apps and web pages adhere to a consistent standard for text markup (this just refers to the additional, invisible information that stores the format and structure of text) while desktop apps unfortunately do not. Copying from web-based apps almost always works much better, and we've got more work to do to try to wrangle all the bizarre formatting anomalies of desktop apps.
It would also be useful for us to know if you are copying from Word because that's what you are using to write a draft of your story or if you just have a document or report in MS Word format that you need to copy an excerpt from. Would you be able to share some more info about that?
d3342ee215