Solved

run in administrator mode vb6

Posted on 2014-11-11
3
142 Views
Last Modified: 2014-11-19
I am trying to extrapolate data from a file using some vb6 code.  I need to be in Administrator mode when opening certain files and running this code in vb6

Private Sub Command1_Click()
Dim objMSWord As Word.Application
Dim myDoc As Word.Document
Set objMSWord = CreateObject("Word.Application")
Set myDoc = objMSWord.Documents.Open("C:\111114.txt")

For Each p In myDoc.Paragraphs
  If InStr(p.Range.Text, "BlockedIP") > 0 Then
   'Skipping - found text
  Else
    p.Range.Delete
  End If
Next

myDoc.SaveAs ("c:\Users\Me\Desktop\052214_2.txt")
myDoc.Close
Set myDoc = Nothing
objMSWord.Quit
End Sub

Open in new window


Is there a way to run this code in administrator mode?
0
Comment
Question by:al4629740
  • 2
3 Comments
 
LVL 14

Accepted Solution

by:
brendanmeyer earned 500 total points
ID: 40436676
you wil have to run the exe in administrator mode
0
 

Author Comment

by:al4629740
ID: 40436681
Is there a way for the program to prompt the exe to run in administrator mode?
0
 

Author Closing Comment

by:al4629740
ID: 40454182
Unresolved answer
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Excel Vlookup to move data back to source. 4 91
VB error "Type mismatch" 2 54
Computer crashes, following error message in event manager 5 199
Run code from text file in vb 1 64
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

778 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question