Click here to Skip to main content
15,924,317 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralMake a HTTP request in VBScript Pin
19-Aug-01 16:59
suss19-Aug-01 16:59 
GeneralRe: Make a HTTP request in VBScript Pin
Vasudevan Deepak Kumar24-May-07 22:28
Vasudevan Deepak Kumar24-May-07 22:28 
Generalaxdist.exe and PD's setup.exe Pin
Ronb18-Aug-01 19:21
Ronb18-Aug-01 19:21 
GeneralVBA Drag and drop within listbox Pin
18-Aug-01 5:54
suss18-Aug-01 5:54 
QuestionRegistry and backingup with VB? Pin
Yoav16-Aug-01 6:28
Yoav16-Aug-01 6:28 
GeneralFtp Sessions Pin
16-Aug-01 3:40
suss16-Aug-01 3:40 
GeneralRe: Ftp Sessions Pin
Anders Molin20-Sep-01 11:03
professionalAnders Molin20-Sep-01 11:03 
GeneralWord/Excel Macros Pin
15-Aug-01 8:32
suss15-Aug-01 8:32 
Hello,
I have a slight problem that I can't seem to get figure out. In MSword, I have a macro that scans for comments and saves them to a text file along with its extra info in a csv format. With this, I import it to excel and get the ref number, page number, who wrote it, etc. What I need help with is, can someone help me w/ code they already have that will have a macro that lets you choose a word file, and scans it, and places the fields into it without having to create a "middleman" file and without having to open up word?


==================================================================================================
Open "C:\Windows\Desktop\output.txt" For Output Access Write As #1
Dim Item As Integer
Item = 0
For Each Comment In ActiveDocument.Comments
With Comment
If Left(.Reference.Paragraphs(1).Style, Len("Heading ")) = "Heading " Then
Else
.Reference.GoToPrevious (wdActiveEndAdjustedPageNumber)
End If
Section = .Reference.GoToPrevious(wdGoToHeading).Paragraphs(1).Range.ListFormat.ListString
Page = .Reference.Information(wdActiveEndAdjustedPageNumber)
Author = .Author
Text = .Range.Text
Line = .Reference.Information(wdFirstCharacterLineNumber)
Doctext = .Scope.Text
'MsgBox "Section number is " & .Reference.GoToPrevious(wdGoToHeading).Paragraphs(1).Range.ListFormat.ListString & vbCr _
' & "Line number on page is " & .Reference.Information(wdFirstCharacterLineNumber) & vbCr _
' & "Page number is " & .Reference.Information(wdActiveEndAdjustedPageNumber) & vbCr _
'& "Text is '" & .Range.Text & "'"
Item = Item + 1
Print #1, Item; ","; Page; ",'Sec "; Section; "','Line "; Line; " on page','"; Author; "','"""; Doctext; """: "; Text; "'"
End With
Next
Close #1
End Sub
=================================================================================================

This code is somewhat ugly, and needs some cleanup, but if someone could show me how to at least initiate the open/import in excel, i can still use this code for the processing.

Thanks

P.S. Is there anyway to create a (a right click) menu item that will run the macro?
GeneralRe: Word/Excel Macros Pin
20-Aug-01 3:51
suss20-Aug-01 3:51 
GeneralRe: Word/Excel Macros Pin
25-Aug-01 6:47
suss25-Aug-01 6:47 
GeneralRe: Word/Excel Macros Pin
26-Aug-01 8:20
suss26-Aug-01 8:20 
GeneralUsing Static Library in VB Pin
13-Aug-01 22:47
suss13-Aug-01 22:47 
GeneralRe: Using Static Library in VB Pin
Pete Bassett16-Aug-01 6:31
Pete Bassett16-Aug-01 6:31 
GeneralRe: Using Static Library in VB Pin
3-Sep-01 12:14
suss3-Sep-01 12:14 
GeneralRe: Using Static Library in VB Pin
8-Dec-01 21:30
suss8-Dec-01 21:30 
QuestionHow to deal with images Pin
13-Aug-01 2:43
suss13-Aug-01 2:43 
GeneralQuick question Pin
Steve Thresher10-Aug-01 3:17
Steve Thresher10-Aug-01 3:17 
GeneralRe: Quick question Pin
Yoav16-Aug-01 6:36
Yoav16-Aug-01 6:36 
GeneralPackaging and Deployment Pin
Ronb9-Aug-01 18:26
Ronb9-Aug-01 18:26 
Questionhow to deploy a excel application Pin
zecodela9-Aug-01 18:25
zecodela9-Aug-01 18:25 
GeneralCopying files Pin
MARNEFFE Philippe7-Aug-01 9:27
MARNEFFE Philippe7-Aug-01 9:27 
GeneralRe: Copying files Pin
Cem Kalyoncu7-Aug-01 12:24
Cem Kalyoncu7-Aug-01 12:24 
GeneralRe: Copying files Pin
chris foote7-Aug-01 17:19
chris foote7-Aug-01 17:19 
QuestionChanging the clipboard from VB for applications? Pin
Daniel Fallman31-Jul-01 1:08
Daniel Fallman31-Jul-01 1:08 
GeneralMulti language Pin
30-Jul-01 23:19
suss30-Jul-01 23:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.