Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Determining Vertical Position In A Word Document Using Vba


Hello.

I'm wondering how I would determine, using VBA, how far down a page from the top an element on a word document is located?

Here's my situation:

I have a document with three tables. The last (bottom) table is static (always the same size). The top table is fairly static, but the row heights do change slightly depending upon information entered in a userform (which then populates the table).

The middle table is the one I'm interested in. I use a userform to have new rows added to the second table and populate the new row.

I want to limit the size of this middle table so that it does not allow a second page to be created. Currently, I'm using height rule to add the row heights of each row in this table, and then I check to see if the total height is greater than a certain number.

Obviously, this method has some drawbacks. If the top table gets unusually large (which it may in rare occasions), then the middle table may still be to large and thus bump to a second page. Also, in my row height check, I make a big assumption that if a new row was added, it would have the same row height as the last current row in the table. And, the 'certain number' I compare to is a set number, while in reality the total avaialble height of the table will depend on the total height of the first table. I suppose I could add the total height of both tables, and then compare THAT to a 'certain number', but there must be a much simpler way to go about it!

I'd like instead to be able to check the table height by comparing the absolute position of the bottom of this table (from the top of the document) against a predetermined maximum distance from the top.

All help or comments are appreciated!

Thanks,
Corey Dale




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Determining Version Of Word That CREATED A Document
I'm trying to use VBA to detect the version of Word (e.g. Word 2000 - 9.x - or Word 2002 - 10.x) that CREATED a document, regardless of what version of the Word application is actually running.

It appears that ActiveDocument.Application.Version returns the same as Application.Version, whether or not the document was created in Word 9.x or Word 10.x.

In Windows XP (the OS), the "Application Name" is part of the file properties, and it contains the accurate version name, that is, "Microsoft Word 9.0" or "Microsoft Word 10.0".

Any thoughts?



Edited by - eowen on 1/30/2004 4:41:20 PM

Can I Insert A Word In The Cursor Position In A Word Document
I use this statement in VBA2000:

ActiveDocument.Content.InsertAfter ("USA")

but it alwasy insert at the end.

How can I insert a word in the cursor position?

Position Shape In Word Document
hi,
I am able to overlap jpg picture in word document. Now I am trying to position it over the selected text. How can I do that?
I am using following code and able to position but its not working perfectly.
I am using information(wdHorizontalPositionRelativeToTextBoundary) to get insertion location.

Code:
Dim app As Object
Dim myDocument As Document
Private Sub Command1_Click()
runWord
SelectionFind text1.Text
insertImage

End Sub

Sub runWord()

Set app = CreateObject("Word.Application")
Set myDocument = Documents.Open(FileName:="c:data.doc")
app.Visible = True
myDocument.Paragraphs.LineSpacing = 24

End Sub

Sub insertImage()
setProperty
End Sub

Sub setProperty()
Dim imageName As String
Dim offsetY, offsetX, offsetWidth, offsetHeight As Integer
imageName = "c:circle.jpg"

myDocument.Shapes.AddPicture FileName:=imageName
ActiveDocument.Shapes(1).WrapFormat.Type = wdWrapNone
ActiveDocument.Shapes(1).ZOrder msoSendToBack
ActiveDocument.Shapes(1).ZOrder msoSendBehindText
SelectionFind (mainfrm.text1.Text)
ActiveDocument.ActiveWindow.View.Type = wdPrintView

ScaleMode = 3



x = Selection.Information(wdHorizontalPositionRelativeToTextBoundary)
y = Selection.Information(wdVerticalPositionRelativeToTextBoundary)
ActiveDocument.Shapes(1).Width = TextWidth(Selection.Text) + 4


ActiveDocument.Shapes(1).Left = x + offsetX
ActiveDocument.Shapes(1).Top = y + offsetY
End Sub


Sub SelectionFind(strFind As String)
Dim temp As String
With app.Selection.Find
.Text = strFind
If .Execute = True Then
MsgBox "Text found.", vbOKOnly

End If
End With

End Sub

I am attaching output file. my objective is to take selected text inside circle picture. When I select bigger or smaller text and that will difference in allignment. How can I maintain allignment regardless of text length.

I only want to insert picture over selected text. but search method search all document so if there are some other matches that will make improper operation.. How can I do that?

Thanks

Help! How Can I Position A Form On Top Of A Word Document?
I have a Word document that pops up a userform when certain fields on the Word document are entered. Is there any way to figure out the position of the control on the form so I can position my vb form on top of the control on the Word document, taking into account screen resolution, zooming, scrolling, toolbars, etc...?
I've worked it out except for vertical scrolling and zooming, but it seems like a convaluted way of doing it. Is there an easy way to do this?

Getting Character Position Of String In Word Document
Hi,
The motivation for my question is this:
I intend to introduce tags into a Word document and use them for formatting.
For example, somewhere in the document The following string is inserted:

<b>My bold string</b>

I need to find this string programatically and format it, removing the tags.

I thought I could do it using the Find object and getting the character positions of the tags. I couldn't figure out how to do it. I was dismayed to find out the Find object does not provide the Start and End character positions.
Any ideas?

Thanks, Ron

Find Curser Position On Word Document
Hi

Is there any command that will show me an integer/long value for the curser or scroll bar position in a word document

so that when i find a word in the document i can tell if it before or after a position stored in a variable?

Mouse/cursor Position In Word Document
I'm using Word automation in my VB6 application.
*What i want to do:
-I have several textbox shapes. When i click in one (Postalcode) i am showing a button (is a small vb form, so the word textboxshape keeps focus).
This allready works fine. Only i can't get the form/button to position corectly.
I want it placed right to the active TextBoxshape. The problem is getting the correct screen x y for this to place my form. I can't use api GetCursorPos because this follows the mousecursor and is not reliable. Getting the textbox x y i can do

Code:set Tbox = Appword.selection.ShapeRange
pt.x = scalex( Tbox.left, vbpoints,vbtwips)
pt.y = scaley(tbox.top,vbpoints, vbtwips)

frmPostalCode.show vbmodeless
frmPostalCode.Move pt.x, pt.y

'I probable should allso add the Word window left and top.
pt.x = scalex( Tbox.left + AppWord.left, vbpoints,vbtwips)
pt.y = scaley(tbox.top+AppWord.Top,vbpoints, vbtwips)
Only these x y values aren't correct (to small) probably caused by the word document's position having gray area around , i should then proably get the coordinates of the left top position of the white document leftup corner.

*An alternative solution would be to create a button/picture in word doc itself.
Only more difficult to keep the focus on the active textboxshape. Allso a don't wonna use a command button (try to avoid using the Word build in VBA designer). The above solution with vbform seems better to me.

The result wil be this. Word document is open. User clicks on postal textbox shape, a arrowbutton amerges. User clicks arrowbutton and a dbgrid form popsup and user browses to the destination corresponding and pushes the arrowbutton again, which now fills in the Locationfield next to the postalcodefield/textboxshape.
 





Edited by - lvermeersch on 11/21/2005 11:07:13 PM

How Can I Find The Position Of Bookmark In A Word 2000 Document?
I've been struggling with a particular report for a while now, and hope that the VB community can help me with this problem. I want to find the position of a bookmark or form field in a word document. (I'll explain my situation below)

I have attached a jpg with an example of what I am trying to do.

The report has a header always at the top of the first page. (I can't use a header though because I have several form fields in it, but thats no biggie). Usually, the header + body + footer will fit on a single page and nothing goes wrong. However, when the body causes the footer to go to the next page, I am required to show this footer only on the bottom of the last page of the report (which probably will never be longer than 2 pages, but I don't want to assume that).

Initially I thought this could be done with tables and continuous sections in Word, but I haven't had any luck.

Why do I want to find the position of a form field or bookmark? At the beginning and end of the footer section, I've placed textboxes. (txtBegin and txtEnd). I think that I can add a carriage return until I determine these boxes are no longer on the same page, and then I can delete the last carriage return and this footer will sit perfectly at the bottom of the page.

These are my thoughts for a solution. I'm hoping that someone can help me find a way to determine the line or page the bookmark is located on, but I would be welcome to any suggestions at this point.

Thanks for any help the vb community can provide.
Tyler Dueck
dueck@hadmacker.com

VB6 Listview: Vertical Scrollbar Position
Hi,
I'm using a listview with two columns to display items from a file, the listview control adds all my data but each time i "refresh" it the vertical scrollbar automatically adjusts itself to the centre. ie. skipping the first items and showing all the items in the centre by default. How can i rectify this?

Thanks

DBGrid Vertical Scroll Bar Position
How does one get the position of the vertical scroll bar? I would like to come back to the same position in the grid after visiting another page.
Thanks

Lock Vertical Scroll Bar In The Top Position In Access XP
Hello, here is my problem. I have a form in MSAccess with a form header and footer, a tab strip control with 9 tabs. In 8 of the tabs I have sub forms attached. The problem I have is when a user clicks a tab other than the first tab and if the child form is taller than the window verticle scroll bars will appear on both the child and the parent forms. The scroll bar the parent form will appear with the "thumb" somewhere less than max causing the tab strip to disappear under the form header. While this is not a show stopper it is an irritant to myself and the users of the database. What I would like to is lock the scroll bar on the parent form in the top position on each tabs click event.

I think the only way I can do this is with API functions (Let me know if I'm barking up the wrong tree). I've never used an API function before so I've spent the day giving myself a crash course in MSDN and this site. I've come up with two functions that I believe will do the task. I would like to know if I'm correct and I could use a few pointers in implementing them.


Code:
Private Declare Function SetScrollPos Lib "user32" (ByVal hWnd As Long, ByVal nBar As Integer, _
ByVal nPos As Integer, ByVal bRedraw As Boolean) As Integer
Private Declare Function GetScrollRange Lib "user32" (ByVal hWnd As Long, ByVal nBar As Integer, _
ByVal lpMinPos As Long, ByVal lpMaxPos As Long) As Boolean

All the examples I've seen have had to do with recording the position of the thumb or getting the range of the scroll bar, I've yet see anything on forcing the thumb position.

What do I use for parameter values when I call these functions. I know I can get the max position from GetScrollRange but I don't know what to use as parameters for that.

Any suggestions will be apreciated.

How To Bring The RichTextBox Vertical Scrollbar To Lowest Position ?
Hi all . i am adding data to richtextbox and want the scrollbar to move to lowest position each time data get entred. Could you any show me how that can be done.Thabnks


2 Code:
form1.RichTextBox1.Text = ChatText$

Excel: Determining Active Cell Position
I am writing a VB Excel Macro and I am using the following code to determine the position of the active cell.


VB Code:
Dim InitialRow As Integer    Dim InitialColumn As String      InitialRow = ActiveCell.Row    InitialColumn = ActiveCell.Column


The problem is ActiveCell.Column returns an integer (i.e. it returns 3 instead of C). Does anyone know a way to return a C, or to convert the 3 to a C)?

If someone knows a function to return the full cell name (Column & Row instead of Column and Row individually), that would also work.

The reason that this is a problem is because I want to select this cell later using the function Range(<Cell>).Select, where Cell = String & Integer

Opening Word Document From Excel When The Word Document Is Read Only
I'm trying to open a Word document from Excel and have hit a snag. The file I'm trying to access is Read-only and the code stops when the "This file is read-only..." prompt displays. How do I get past this? Here's the code that I have so far (thanks to some help from this forum):

Code:
Sub OpenAndPrint()
Dim wdApp As Word.Application
Dim wdDoc As Word.Document
Dim stPathName As String

stPathName = Range("B4").Hyperlinks(1).Address

If Dir(stPathName) <> "" Then
Set wdApp = New Word.Application
wdApp.Visible = True
wdApp.DisplayAlerts = wdAlertsNone 'Tried to turn off the prompt, but it didn't work.
Set wdDoc = wdApp.Documents.Open(stPathName) 'Code stops here and waits for the user to respond to the prompt.
Set wdDoc = Nothing
Set wdApp = Nothing
Else
MsgBox "The file does not exist!", vbInformation
End If

End Sub

MS Word 2000: Closing Forms In A Document From Another Document With Code
I have a project, in which I use a global template to manipulate different other templates. In those templates there are Userforms built in to gather information to use in a MailMerge. The problem I'm having is that I want only to hide the forms in the templates themselves, and close them in the global template when the whole application is closed. The trouble is that I can't find a way to access the open forms from the global template. Can anybody help me?

Word: Determining # Lines
Hello everyone! Had some trouble trying to figure this one out. I wonder if I'm doing something wrong?

If I have a given height in points, how do I determine how many lines of text can fit in that space?

I do something like this with the document that has an inline shape/embedded picure in it:
Code:
ActiveDocument.Paragraphs.LineSpacingRule = wdLineSpaceSingle
ActiveDocument.InlineShapes(1).Activate
'ActiveDocument changes to the word picture editor and what was the inlineshape
'in the old ActiveDocument becomes a shape in the new ActiveDocument

'The height of the shape is 240.05
PointsToLines (ActiveDocument.Shapes(1).Height) 'returns 20
'Although the above function returns 20, I can only fit 17 lines of text. I need help accounting & correcting for the difference.


v/r,
Chris

Control Text Position In Print Document
I want to print some text from a string. But the text printed at the left edge of the paper... how can i control the text position so that the text can be print to other area of the paper??

How To Append New XML Node(s) To A Specified Position In An Existing Xml Document?
hi I have an XML document. The structure looks like this:

(please disregard why there'll be such an XML document as it's for demonstration purpose)

<profile>
<item>
<description>This is the first</description>
<release_date>01-02-2007</release_date>
<price>400</price>
</item>
</profile>


Now I wanna add the following nodes after the <item> node:

<customer id="001" name="Peter" />
<customer id="002" name="Mary" />

So, the output should look like

<profile>
<item>
<description>This is the first</description>
<release_date>01-02-2007</release_date>
<price>400</price>
</item>
<customer id="001" name="Peter" />
<customer id="002" name="Mary" />
</profile>


How can I do this using VB.NET, with the ability to save the final output by overwritting the original xml document?

Word: Determining The Width Of A Range
Does anyone know how to determine the width of a range in either points or pixels?

v/r,
Chris

VBA W/WORD : Determining Page Number Of Range
How do you determine which page a character is on in a Word Document using VBA?

Word Macro Determining Template Styles/formatting
Hello all. I have defined a template for Word. What I want to do is to write a macro that will search through the document (based on my template) and depending on the formatting will insert tags before and after each formatting instance.

So, say I have a style that is named "Header 1". I would like to search through the document for each instance of this style, and insert "<BTT: Heading 1>" before, and "<ETT>" after it.

I have searched all through the site and all through the internet, and have been able to find nothing specific to what I'm trying to do. Any help would be much appreciated.

Determining Microsoft Word Version Using Visual Basic
I am trying to write a filter script and I would like the script to know if it is running on MS word 97,98 or 2000. How could I do this. ie. How could I write the code to determine or check what verison of MS word I am using. Thanks

Merging/Importing Word, Excel, Powerpoint And Visio Files Into A Word Document
Does anyone know how to do this or know of a website that has source code that does this? I can't find anything anywhere.

Each Page/Worksheet/Slide goes on a seperate page. Print formatting is retained (landscape/portrait) and if the imported Page/Worksheet/Slide is larger than the page im merging/importing to, it should auto-resize to fit the page.

Thx.

Reading The Word Document From Visual Basic Without Opening The Word Applicaiton
Hi

I need to access the word document from visual basic without opening the word application. I can do this by opening the word application. Is there any other way to read a document from vb.

I need to search for a particular word in the document without opening the word application.

Waiting for your reply,

thanks

Mohan

Accessing Word Document 'header/footer' Via Word Object Library
Hi All

As the title suggests really, I can access everything I need on a Word document opened via the Word Library object but I can't find how I access the headers and footers of a docuemnt

Many Thanks
Steve

Merging Word, Excel, Powerpoint And Visio Files Into A Word Document
Does anyone know how to do this or know of a website that has source code that does this? I can't find anything anywhere.

Thx.

I posted this in VB General but then i saw this forum so I wasn't sure where it belonged and posted in both. Reply to either one.

Error 4605 Calling Word.Document.Save With Word 2002 SP1
I have a test VB6 exe project with a WebBrowser control, called web1 (added via Project, Components, Microsoft Internal Controls). My project also references the Microsoft Word 10.0 Object Library.

As well as the WebBrowser control, my form has a Save button (cmdSave). Here is the complete code:


Code:

Private g_objDocument As Word.Document

Private Sub cmdSave_Click()
g_objDocument.Save
End Sub

Private Sub Form_Load()
Dim strFileName As String
strFileName = App.Path & "WordWrapper.doc"
web1.Navigate strFileName
End Sub

Private Sub web1_NavigateComplete2(ByVal pDisp As Object, URL As Variant)
Set g_objDocument = pDisp.Document
End Sub


The idea is when I run the exe, it loads a Word document into the WebBrowser control. This document is also assigned to
a global Word.Document object, g_objDocument, when web1 navigates to it. The problem occurs when I try to save the document (in cmdSave_Click). I get the error:

"The Save method or property is not available because this document is in another application."

This error occurs with Word 2002 SP 1 (on Windows XP), but not with Word 2000 SP3.

Please help.

Load Word Document In VB Form And Use Word's Zoom Features - Help
Hi

I've this VB6 application where I can opt to load a word document or scaned 8X11 image of a paper form on the VB form and let user write or draw using a tablet. Since screen doesn't have enough space to show complete form at one time, I need to zoom it down to fit the screen so it get mapped properly with tablet. Once user is done drawing or writing, I need to bring the document or image back to original size and print it or save it.

I don't know where to start. Plese guide me about the best way to accomplish this. Thanks.

Convert Html To Word Docuemtn Using The Word Document Object
i ant in vb6 to open an html page
and convert and save it as word *.doc
how can i do this?
and is it possible to open the html file from the internet with a give url so i will be :
open html document from www..../1.html -> save as 1.doc
thnaks in advance
peleg

Load Word Document On VB Form And Use Word's Zoom Fetrures - Help
Hi

I've this VB6 application where I can opt to load a word document or scaned 8X11 image of a paper form on the VB form and let user write or draw using a tablet. Since screen doesn't have enough space to show complete form at one time, I need to zoom it down to fit the screen so it get mapped properly with tablet. Once user is done drawing or writing, I need to bring the document or image back to original size and print it or save it.

I don't know where to start. Plese guide me about the best way to accomplish this. Thanks.

VB In Access To Find And Format A Word In A Mailmerged Word Document
I use my Access data base to create mail merged letters to our customers. Not only are the names etc stored on the database I also store the content of the letter in memo fields. I have occasions where I want the newly created letter to have some words bold. After having VB code open the main document, mail merge then close the main document I run the following code. It works the first time round, the specified word becomes bold. However after closing the letter and running it a second time the new letter opens but no changes are made and I get an error. "Run Time error '462' : The remote server machine does not exist or is unavailable". This gives me a Debug option. When selecting debug The first row in this code is selected.

With ActiveDocument.Content.Find

    .ClearFormatting
    .Font.Bold = False
    .MatchCase = True
    .Text = "SATURDAY"
    With .Replacement
        .ClearFormatting
        .Font.Bold = True
        .Text = "SATURDAY"
    End With
    .Execute Format:=True, Replace:=wdReplaceAll
End With

If I leave the new letter open and re run it the code opens a second new letter with no errors, however it does not make the changes to the newest document only the first new document it finds. ie If I then close the first one created and rerun it the second document will have the changes made and the third one does not change. The error only occurs once I have closed all new documents and try to open another letter.


Hope someone can help

MSAccess Database DOA

Word Automation - Retaining The Numbering Format In New Word Document
Hi all,

I am using word automation to read a word document. I use word automation to read the word document page by page and paste the contents of each page in a new document.

The problem i am facing is, the word document which is read contains Heading1,Heading 2 etc and these are numbered. When I paste these pages onto a new document the numbering is not retained. (Eg., if my Heading1 number is 2.1 when i paste it in a new document the Heading1 number is shown as 1.1)

VBA: Creating Word, And Sending Data To A Word Document Using Ranges
The following code works fine when it is executed only once in any instance of the VB program.

It is OK provided I do not close Word, and it will create multiple instances of the document into the same instance or word.

Screen.MousePointer = 11
GetWord2
WordApp.Documents.Open ("C:Program FilesWill WizardTemplatesClauseLib.doc")
set MyDoc = Documents.Open(FileName:="C:Program FilesWill WizardTemplatesClauseLib.doc")
set FldRng(1) = MyDoc.Range(Start:=MyDoc.Bookmarks("Name").Range.End, End:=MyDoc.Bookmarks("NameEnd").Start - 1) 'read bookmarks into range object variables
FldRng(1).Text = ClauseHold 'put the stuff into the document
WordApp.ActiveDocument.SaveAS FileName:=("C:Program FilesWill WizardTemplates emp" & Trim(Str(TMPNum)) & ".doc")
WordApp.Application.Activate
WordApp.Visible = true
set WordApp = nothing
set MyDoc = nothing
Screen.MousePointer = 0
Command8.Enabled = true
Exit Sub



If Word is closed, and the code is executed again, an error occurs "the remote server machine does not exist or is not available" The only remedy for this is close and re-start the VB application containing this code.

The GetWord2 et-al Function codes are: (which is stored in a module)

option Explicit
Declare Function FindWindow Lib "user32" Alias "FindWindowA" (byval lpClassName as string, byval lpWindowName as string) as Long
Declare Function SendMessage Lib "user32" Alias "SendMessageA" (byval hwnd as Long, byval wMsg as Long, byval wParam as Long, byval lParam as Long) as Long
public WordApp as Word.Application
public WordWasNotRunning as Boolean ' Flag for final word unload

public Sub DetectWord()
' Procedure detects a running Word and r
' egisters it.
Const WM_USER = 1024
Dim hwnd as Long
' If Word is running this API call retur
' ns its handle.
hwnd = FindWindow("OpusApp", vbNullString)
If hwnd = 0 then ' 0 means Word Not running.
Exit Sub
else
' Word is running so use the SendMessage
' API function to enter it in the Running
' Object Table.
SendMessage hwnd, WM_USER + 18, 0, 0
End If
End Sub
public Sub GetWord2()

' Test to see if there is a copy of Micr
' osoft Word already running.
on error resume next ' Defer error trapping.
' Getobject function called without the
' first argument returns a
' reference to an instance of the applic
' ation. If the application isn't
' running, an error occurs.
set WordApp = GetObject(, "Word.Application")
If Err.Number &lt;&gt; 0 then
WordWasNotRunning = true
else
WordWasNotRunning = false
End If
Err.Clear ' Clear Err object In Case error occurred.
' Check for Microsoft Word. If Microsoft
' Word is running,
' enter it into the Running Object table
' .
DetectWord
If WordWasNotRunning = true then
'set the object variable to start a new
' instance of Word.
set WordApp = new Word.Application
End If
' Show Microsoft Word through its Applic
' ation property. then
' show the actual window containing the
' file using the Windows
' collection of the MyWord object refere
' nce.
WordApp.Visible = true
WordApp.Application.WindowState = wdWindowStateNormal
Screen.MousePointer = vbDefault
End Sub



do I need to close the document? = deactivate something?

I would like a code example on how to fix the above, else, any suggestions, ideas...


Jason.

A Search Of A Word Document And .XLS Document
Hello,
I need to search a word document for time values that look like this 13:43:42. Find them in a spreadsheet document. Once found there are 3 columns of data in the .xls that correspond to the time. This then needs to go into a .txt file. Then need to search the word document again for the next time and do again. When done the final .txt file should have the time and cooresponding data across the page. Who out there can put this together to run in a macro?

Word Document (*.DOC) And WordPad Document (*.DOC) ?
Hi,

I need to identify that a document file (*.DOC) is a Word document or a WordPad document in me program. Because WordPad can not open always a file (*.DOC) which can be openned by WORD.

Thanks

nYU

Word: Counting A Specific String In A Word Document
Hi all,

After visiting the Word FAQ I couldn't find any clue for my query:
I would like to count (in VB) how many times the string "Yesterday"
appears in a word document I am working on.

By using the manual Replace function (replacing "Yesterday" by "Yesterday"),
Word tells you how many replacement it has done and therefore how many
instances of the string "Yesterday" were in the document.

Can anyone point me in the right direction about using VB to find out
how many times "Yesterday" appears in my document, please?

Many thanks
Francois

Selecting A Particular Word From A Word Document (.doc) Through Visual Basic 6
I am a developer using Visual Basic 6. One of my program accepts some values through text boxes and then creates a Word document. The text boxes are optional, and the created Word document contains only non-empty values along with appropriate labels. I am able to apply styles (bold and underline) to entire paragraphs. But the user wants me to apply bold formatting only to values entered by him and not to the labels which describe those values. Please help me.

Thank You.

Lalit Kumar Barik
India

Open A Document Word From A Template Of Word
Hello, I'm working in Visual Basic 6 and I want open a document word. But this document must be from a template of word (its name is Informe).

I do it with the code
Dim objWord As Word.Application
Dim objDoc As Word.Document

Set objWord = New Word.Application
Set objDoc = objWord.Documents.Add("C:Informe.dot")

It's ok but I only see the document, I want to see the menus of word,....
If it isn't possible can you send me the code to print this document?


Thank's and sorry for my poor english

Word Form &gt;&gt; Process &gt;&gt; Word Document
Please be gentle, as this is my first foray into VBA. To make matters worse, I'm not a programmer, just someone who needs to get something done. My guess, based on what I want to do, it that I can do it easiest in VBA, but I am hoping this forum will help flesh out that answer for me.

In a nutshell, I am trying to create a document (possibly a Word form?...) that has a definite format with fields to be filled in (mostly numberic values, checkboxes, or free text). This form will be filled out by our techs at a customer site. They may do this 'live' with Word open, or they may print it out, then fill in the document later from their handwritten copy.

Next, I would like to 'process' their answers by feeding some information directly into an output document (Word hopefully). Now, some fields like name, address, etc... will go straight over and don't require manipulation. Some other data will need to be processed.

For example, if the tech fills in 34, I might want the output document to put 'this text' under a certain heading. If it is >34, then some other text, less, maybe no text. I'd also like to be able to change some graphics based on limits. i.e. if the value is less than this, insert this picture into the output document at a specific location, if not, insert this picture.

So, in general, before I go down the road of learning a language... do the members here think VBA would be a good choice for this? Would I 'read' from the input document in Word Excel, process in Excel and then pump data out to the output docment, etc... I am looking for advice whether this is;

1. fairly straightforward, understanding that I would need to learn some VBA.
2. possible
3. a good choice. i.e. would another language, or a pre-done software make a better choice.

My contraints are that my company has Office 2000 rolled out, WITHOUT Access. We use Lotus Notes and Access is apparently frowned upon. I am an optimist, so I expect it's possible with careful design and help from the experts who've been down these roads before.

Thanks in advance for any help, insight, advice or code.

Regards,
John

Opening A Word Document With Word From Excel
i want to have a part of an excel macro where it opens up a word document in word (so it would have to open the application itself) and then be able to do everything that i can do using the word vb editor. is there some easy way to do this?

Opening An Application Such As Word Document Using Word
how to open a .doc file using a word exe through vb gui.

regards
raghav

Change Word On The Footer Of A Word Document
I like to change the word "Version 1.0" to "Version 2.0" on every page on the footer of a word documents using VB6 with the word document minimised when the program is making the change. Does anyone know how to do this? Thanks.

Word -VBA / Accessing Content Of A Word Document
Group:

Can you access the conent (document.WholeStory or document.Conent) of a Word document without opening the document or triggering the OpenDocument event?

Mark

Deleting Word Document Using Vb For Word 2000
hi

how to delete a word document from the hard disk using vb for word 2000?
i tried using kill function but it shows an error -"permission denied"..pls can sum1 help?

Find A Specific Word From Word Document...
Hi All,

Need help...

i have a word doc. it contains some data.. and bottom of the page it contain the following paragraphs. its single page word doc.
Code:Very truly yours,
sam
Officer

From vb i want to find word, the next line of the 'very truely yours'. like here in this example i have to capture the value 'sam'.

Any idea how to get that..


Thanks
Balakumar

Edited by - pmmbala1976 on 6/2/2004 4:45:19 PM

Deleting Word Document Using Vb For Word 2000
hi

how to delete a word document from the hard disk using vb for word 2000?
i tried using kill function but it shows an error -"permission denied"..pls can sum1 help?

Printing A Word Document Using Word.Application
Is there a way to fire a print out to a particular printer using word.application object

Thanks in advance for any help.

N G

Tricky Search Of A Word In A Word Document...
I need to create a VB project that searches a word in a
Microsoft Word document, counts the number of apearences
and the page and row where the word apeared.

Ex.
Suppose I need to search the word: "please"
The result should be of this form:
please - 1/2,3 ; 4/1,13

This means that the word "please" was found in the document on the line 2 and 3 of the page 1, and on the line 1 and 13 on the
page 4.

Please tell me if this can be done. I need it ASAP.

Thanks.

MsWord - Word Position
Hi,

In a MsWord document, you have at the bottom of it in the "status" bar, page number, section number, page 1/1, at x.y inch, Line X Column Y

I you like to know which LINE and COLUMN my cursor is in when I select a Word.

All done programmatically... Anybody knows how?

Copyright 2005-08 www.BigResource.com, All rights reserved