CNET's Forum on office & productivity software is the best source for finding help, troubleshooting, or tips from a community of experts. Exchange knowledge, and get help on all the latest office. XviD_codec for Mac, free and safe download. XviD_codec latest version: QuickTime component to play and encode XviD files. It's available for users with the operating system Mac OS X and former versions, and you can download it in English. Xvid is a MPEG-4 video codec for PC. Its purpose is to compress video in order to allow for faster transmission over computer networks or for more efficient storage on Also, there are ports to Mac OS X. Note that the most recent versions of Xvid for Windows run only on Windows XP SP3 or newer. Xvid codec update. XviD codec for Mac. The XviD codec isn't yet available for the Mac, so to play XviD videos on your Mac you first need to install QuickTime and the DivX codec. Hi Mike, Word 2003, VSTO 2005, C#, VS.NET 2005 Is there a way to set the location of the cursor in a non-XML word 2003 doc using VSTO/C#? Our users want to automatically insert some text and hyperlinks several times through their document authoring effort. I can insert the text and the hyperlinks but when I'm done the cursor is always at the top of the document. I'd like to do this: 1. User selects a commandbar button: Inserts standard text/hyperlink, I want to leave the cursor on a newline just below what was just inserted. The user will then insert their text a few lines to several paragraphs. From a commandbar button the user will select the next set of standard text. Again, I want to leave the insertion point on a newline below this text. How do I leave the cursor at that new line position? Thanks in advance for any assistance, Paul. When you force a new line in Word (whether by using ASCII 11 or ASCII 13) this does count as an additional character in the document, yes. Even though it's not as '.NET correct', for this reason you might want to use the C# escape codes instead of Environment.NewLine. R is the equivalent of ASCII 13 = new paragraph. Right off-hand I can't remember what the equivalent of ASCII 11 is = new line (Word-specific). Or, you'd need to rebuild your procedure to use the other approach. Here's an untested example, off the top of my head, of how using a single range would work: String text1 = 'The first text.' ; String text2 = 'Some more text '; String text3 = 'A third set of text.' Hi Paul It would make it easier to show you if you supplied the code you're using to insert the content. But I'll assume you're using a Range object, in one way or another, to identify that location. Let's assume you have a range, and you've just put some text in it, like this: rng.Text = 'The new text in the document'; The next thing you need to do is to collapse the range to a single point, following the range. Then select the range. Rng.Collapse(Word.WdCollapseDirection.wdCollapseEnd); rng.Select(); If the text you inserted was at the end of a line, the cursor will be on the next line. If you want a new line as part of the range you're inserting, type the following at the end of the text, above: r. Hi Cindy, Thanks that got me most of the way there. However, after doing the above the cursor, while no longer at the top of the doc is now in the middle of the last sentence. Here's the code: string theLink = '; object oAddress = theLink; // for setting the range of the hyperlink object hypStart; object hypEnd; // we want to collapse the range to the insertion point for the next text object collapseEnd = Word. WdCollapseDirection.wdCollapseEnd; // standard text string startText = 'See this week's Alert: Our items at '; // theLink goes here string nextText = ' for full text of the following reports.' + Environment.NewLine + Environment.NewLine + 'The following selected reports focus on key policy issues or some of the key issues involved that may receive action during the week of ' + DateTime.Now.Date.ToString( 'dddd dd MMMM' ) + ' ' + DateTime.Now.Date.Year.ToString() + '.' + Environment.NewLine; hypStart = startText.Length; hypEnd = startText.Length + theLink.Length; testVSTO. ThisDocument newAlert = testVSTO. Globals.ThisDocument; // set the insertion point to the top of the page Word. Range report = newAlert.Range( ref missing, ref missing); report.Text = startText + theLink + ' ' + nextText + ' r'; // The point at which to insert the hyperlink report = newAlert.Range( ref randStart, ref randEnd); newAlert.Hyperlinks.Add(report, ref oAddress, ref missing, ref missing, ref missing, ref missing); report.Collapse(ref collapseEnd); report.Select(); _______________________________ That is, the last two line of code above leave the cursor at the end of the hyperlink or at hypEnd. If I use this code: report.SetRange(newAlert.Characters.Count, newAlert.Characters.Count); instead of the report.Collapse(ref collapseEnd); the cursor is in the middle of the last sentence (eg: nextText). Thanks again for any assistance, Paul.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |