Solved

run in administrator mode vb6

Posted on 2014-11-11
3
146 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

828 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